From 7a958b8899f128d6ab5393594b989f3178280b57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Mon, 23 Dec 2024 18:30:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E9=94=AE=E7=9B=98=E6=8C=89=E9=94=AE=E5=A4=84=E7=90=86=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/model-custom/components/index.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/model-custom/components/index.vue b/src/components/model-custom/components/index.vue index 7ab74b44..2d738818 100644 --- a/src/components/model-custom/components/index.vue +++ b/src/components/model-custom/components/index.vue @@ -791,6 +791,12 @@ const rect_style = computed(() => { //#endregion //#region 绑定上下左右事件 const handleKeyUp = (e: KeyboardEvent) => { + // 排除默认事件 + const default_list = ['textarea', 'input']; + // 判断是否是用户手动输入的内容 + if (e.target instanceof HTMLElement && default_list.includes(e.target?.localName)) { + return; + } let key_code = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight']; let x = 0; let y = 0;