diff --git a/src/components/common/FTInput/index.vue b/src/components/common/FTInput/index.vue index e8f2802..3ef9c72 100644 --- a/src/components/common/FTInput/index.vue +++ b/src/components/common/FTInput/index.vue @@ -83,6 +83,10 @@ emits('focus') // }, 100) const blurInput = () => { + if (ignoreBlur.value) { + ignoreBlur.value = false + return + } setTimeout(() => { if (!entering.value) { handleClose() @@ -167,13 +171,20 @@ const onKeyPress = (button: any) => { return handleBackspace() } +const ignoreBlur = ref(false) + const handleBackspace = () => { + ignoreBlur.value = true // const position = keyboard.value.getCaretPosition() // console.log(position) const value = model.value?.toString() || '' model.value = value.slice(0, -1) console.log(model.value) + // 设置短时间延迟恢复 blur 监听 + setTimeout(() => { + ignoreBlur.value = false + }, 150) } const handleLock = () => { @@ -244,6 +255,9 @@ const handlePopClose = (e: any) => { inputRef.value.ref.selectionStart = inputRef.value.ref.selectionEnd = index inputRef.value.focus() } + else { + console.log('失去了') + } } const close = () => {