Skip to content

Commit

Permalink
Refactor #6317
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Nov 13, 2024
1 parent 1e70511 commit a1f811a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/primevue/src/inputotp/InputOtp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
</template>

<script>
import { isTouchDevice } from '@primeuix/utils/dom';
import InputText from 'primevue/inputtext';
import BaseInputOtp from './BaseInputOtp.vue';
Expand Down Expand Up @@ -71,11 +72,7 @@ export default {
if (event.inputType === 'deleteContentBackward') {
this.moveToPrev(event);
} else if (event.inputType === 'insertText' || event.inputType === 'deleteContentForward') {
this.moveToNext(event);
} else if (event instanceof CustomEvent) {
// iOS/macOS one-time-code autocomplete uses CustomEvent vs. InputEvent for each character in the code
// If moveToNext is not called, it will continue to append the next value after the first character
} else if (event.inputType === 'insertText' || event.inputType === 'deleteContentForward' || (isTouchDevice() && event instanceof CustomEvent)) {
this.moveToNext(event);
}
},
Expand Down

0 comments on commit a1f811a

Please sign in to comment.