Skip to content

Commit

Permalink
fix(VOtpInput): partial revert of 32b30cf
Browse files Browse the repository at this point in the history
fixes #19439
  • Loading branch information
johnleider committed Mar 20, 2024
1 parent dfcc6a3 commit c1e75bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vuetify/src/components/VOtpInput/VOtpInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export const VOtpInput = genericComponent<VOtpInputSlots>()({

const clipboardText = e?.clipboardData?.getData('Text') ?? ''

if (!isValidNumber(clipboardText)) return
if (isValidNumber(clipboardText)) return

model.value = clipboardText.split('')

Expand All @@ -192,7 +192,7 @@ export const VOtpInput = genericComponent<VOtpInputSlots>()({
}

function isValidNumber (value: string) {
return props.type === 'number' && !isNaN(Number(value))
return props.type === 'number' && /[^0-9]/g.test(value)
}

provideDefaults({
Expand Down

0 comments on commit c1e75bb

Please sign in to comment.