From 5cc0aec2fcef3fa3a57b8daffed36939090b9f52 Mon Sep 17 00:00:00 2001 From: guoapeng Date: Sun, 6 Jul 2025 22:26:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=B8=80=E7=89=88=E8=99=9A=E6=8B=9F=E9=94=AE=E7=9B=98=E5=BF=AB?= =?UTF-8?q?=E9=80=9F=E7=82=B9=E5=87=BB=E5=92=8C=E9=95=BF=E6=8C=89=E6=B6=88?= =?UTF-8?q?=E5=A4=B1=E7=9A=84=E9=97=AE=E9=A2=981?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/FTInput/index.vue | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/components/common/FTInput/index.vue b/src/components/common/FTInput/index.vue index 3ef9c72..b4e43f2 100644 --- a/src/components/common/FTInput/index.vue +++ b/src/components/common/FTInput/index.vue @@ -146,13 +146,18 @@ const onInit = (keyboard: any) => { document.addEventListener('click', handlePopClose) } const onChange = (input: any) => { + ignoreBlur.value = true console.log(input) model.value = input + setTimeout(() => { + ignoreBlur.value = false + }, 150) emits('onChange', input) } const onKeyPress = (button: any) => { + ignoreBlur.value = true if (button === '{lock}') return handleLock() if (button === '{change}') @@ -195,6 +200,9 @@ const handleLock = () => { keyboard.value.setOptions({ layoutName: shiftToggle, }) + setTimeout(() => { + ignoreBlur.value = false + }, 150) } const handleChange = () => { entering.value = true @@ -216,12 +224,18 @@ const handleChange = () => { display: displayDefault.value, }) } + setTimeout(() => { + ignoreBlur.value = false + }, 150) } const handleClear = () => { keyboard.value.clearInput() model.value = '' } const handleEnter = () => { + setTimeout(() => { + ignoreBlur.value = false + }, 150) emits('enter') } const handleClose = () => { @@ -230,6 +244,9 @@ const handleClose = () => { // model.value = model.value?.replace(new RegExp(`(\\d+)\\.(\\d{${props.precision}}).*$`), '$1.$2').replace(/\.$/, '') } popoverRef.value.hide() + setTimeout(() => { + ignoreBlur.value = false + }, 150) emits('close') } const handleArrow = (num: number) => { @@ -241,6 +258,9 @@ const handleArrow = (num: number) => { else if (num === 1 && index + 1 <= (model.value?.length || 0)) { keyboard.value.setCaretPosition(index + 1) } + setTimeout(() => { + ignoreBlur.value = false + }, 150) } const handlePopClose = (e: any) => {