File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
packages/vuetify/src/components/VOtpInput Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ export const VOtpInput = genericComponent<VOtpInputSlots>()({
166
166
e . preventDefault ( )
167
167
e . stopPropagation ( )
168
168
169
- const clipboardText = e ?. clipboardData ?. getData ( 'Text' ) . slice ( 0 , length . value ) ?? ''
169
+ const clipboardText = e ?. clipboardData ?. getData ( 'Text' ) . trim ( ) . slice ( 0 , length . value ) ?? ''
170
170
171
171
if ( isValidNumber ( clipboardText ) ) return
172
172
@@ -207,7 +207,10 @@ export const VOtpInput = genericComponent<VOtpInputSlots>()({
207
207
} , { scoped : true } )
208
208
209
209
watch ( model , val => {
210
- if ( val . length === length . value ) emit ( 'finish' , val . join ( '' ) )
210
+ if ( val . length === length . value ) {
211
+ focusIndex . value = length . value - 1
212
+ emit ( 'finish' , val . join ( '' ) )
213
+ }
211
214
} , { deep : true } )
212
215
213
216
watch ( focusIndex , val => {
You can’t perform that action at this time.
0 commit comments