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

feat(VOtpInput): add a bool property masked to show the text or not #20950

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

ankusharoraa
Copy link

resolves #18964

Description

As mentioned in the issue, I have added a masked attribute that can be used with text and number type to mask the input.

Markup:

<template>
  <v-app>
    <v-container>
      <!-- -->
      <v-otp-input v-model="otp" type="text" masked />
      {{ otp }}
    </v-container>
  </v-app>
</template>

<script>
  import { ref } from 'vue';

  import { VOtpInput } from '../src/components/VOtpInput/index.ts'
  export default {
    name: 'Playground',
    components: {
      VOtpInput,
    },
    setup () {
      const otp = ref('')
      return {
        otp,
        //
      }
    },
  }
</script>

@ankusharoraa
Copy link
Author

@johnleider Can you please review this PR

@johnleider
Copy link
Member

Usually this is done by the user via the type prop, switching between password/text|number. This does make it easier but for such a simple component, I'm not sure it's worth inflating it's API.

@ankusharoraa
Copy link
Author

Usually this is done by the user via the type prop, switching between password/text|number. This does make it easier but for such a simple component, I'm not sure it's worth inflating it's API.

Thanks for the feedback! As mentioned in the issue, I’ve added a masked attribute that works with both text and number types to mask the input. My intention was to provide flexibility while keeping the API simple, but I understand your concern about potentially overcomplicating it.

Can you let me know if you’re suggesting a different approach for handling this, or if you'd prefer a simpler method to manage input types and masking? I’m open to suggestions!

@johnleider
Copy link
Member

Maybe instead of a prop we can provide an example in the docs that shows how the user can do it? With masking coming back to the framework soon, I don't want to introduce any potentially confusing API .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants