[InputOtp] select input content when clicking on a box (#6354)

pull/6471/head
MergeSoft 2024-09-24 14:36:12 +02:00 committed by GitHub
parent 6ddc571f48
commit 9939185b5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -18,6 +18,7 @@
@blur="onBlur($event)" @blur="onBlur($event)"
@paste="onPaste($event)" @paste="onPaste($event)"
@keydown="onKeyDown($event)" @keydown="onKeyDown($event)"
@click="onClick($event)"
:pt="ptm('pcInputText')" :pt="ptm('pcInputText')"
/> />
</slot> </slot>
@ -128,6 +129,9 @@ export default {
onBlur(event) { onBlur(event) {
this.$emit('blur', event); this.$emit('blur', event);
}, },
onClick(event) {
setTimeout(() => event.target.select(), 1);
},
onKeyDown(event) { onKeyDown(event) {
if (event.ctrlKey || event.metaKey) { if (event.ctrlKey || event.metaKey) {
return; return;