Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(VOtpInput): update the otp when value changes #14460

Merged
merged 2 commits into from Dec 27, 2021

Conversation

TheoPez
Copy link
Contributor

@TheoPez TheoPez commented Dec 3, 2021

Description

Update the otp input when value changes.
fixes #14437

Motivation and Context

This pull request solves the update problem present on the new VOtpInput component. Indeed, it is impossible to change or to empty the field, even during the reset of a form (see the reproduction in #14437 )

How Has This Been Tested?

Markup:

<template>
  <v-container>
    <v-form ref="form">
      <v-otp-input
        v-model="otp"
      ></v-otp-input>
    </v-form>
    <v-btn @click="$refs.form.reset()">Reset Button</v-btn>
    <v-btn @click="otp = '123'">change otp value to : 123</v-btn>
    {{otp}}

  </v-container>
</template>

<script>
  export default {
    data: () => ({
      otp: '0'
    }),
  }
</script>

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement/refactoring (non-breaking change that doesn't add any features but makes things better)

Checklist:

  • The PR title is no longer than 64 characters.
  • The PR is submitted to the correct branch (master for bug fixes and documentation updates, dev for new features and backwards compatible changes and next for non-backwards compatible changes).
  • My code follows the code style of this project.
  • I've added relevant changes to the documentation (applies to new features and breaking changes in core library)

@johnleider
Copy link
Member

Please create unit tests that correlate to the changes made in this request.

@johnleider johnleider added C: VOtpInput VOtpInput T: bug Functionality that does not work as intended/expected labels Dec 16, 2021
@KaelWD KaelWD merged commit c58f02a into vuetifyjs:master Dec 27, 2021
@TheoPez TheoPez deleted the fix/14437-otp-input branch December 27, 2021 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VOtpInput VOtpInput T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report][2.6.0] v-otp-input : the component does not update the value correctly
4 participants