pull/6775/head
tugcekucukoglu 2024-11-13 10:43:57 +03:00
parent 1e70511ee0
commit a1f811a3f3
1 changed files with 2 additions and 5 deletions

View File

@ -29,6 +29,7 @@
</template> </template>
<script> <script>
import { isTouchDevice } from '@primeuix/utils/dom';
import InputText from 'primevue/inputtext'; import InputText from 'primevue/inputtext';
import BaseInputOtp from './BaseInputOtp.vue'; import BaseInputOtp from './BaseInputOtp.vue';
@ -71,11 +72,7 @@ export default {
if (event.inputType === 'deleteContentBackward') { if (event.inputType === 'deleteContentBackward') {
this.moveToPrev(event); this.moveToPrev(event);
} else if (event.inputType === 'insertText' || event.inputType === 'deleteContentForward') { } else if (event.inputType === 'insertText' || event.inputType === 'deleteContentForward' || (isTouchDevice() && event instanceof CustomEvent)) {
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
this.moveToNext(event); this.moveToNext(event);
} }
}, },