From 9939185b5d165f6953fea467d1df32cb8dadd5c5 Mon Sep 17 00:00:00 2001 From: MergeSoft Date: Tue, 24 Sep 2024 14:36:12 +0200 Subject: [PATCH] [InputOtp] select input content when clicking on a box (#6354) --- packages/primevue/src/inputotp/InputOtp.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/primevue/src/inputotp/InputOtp.vue b/packages/primevue/src/inputotp/InputOtp.vue index 7384a1592..f566166d4 100755 --- a/packages/primevue/src/inputotp/InputOtp.vue +++ b/packages/primevue/src/inputotp/InputOtp.vue @@ -18,6 +18,7 @@ @blur="onBlur($event)" @paste="onPaste($event)" @keydown="onKeyDown($event)" + @click="onClick($event)" :pt="ptm('pcInputText')" /> @@ -128,6 +129,9 @@ export default { onBlur(event) { this.$emit('blur', event); }, + onClick(event) { + setTimeout(() => event.target.select(), 1); + }, onKeyDown(event) { if (event.ctrlKey || event.metaKey) { return;