From 3f5078ec9b25dfd66e033f8d1513916a81ef01c5 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Sun, 14 Jun 2026 23:03:01 +0000 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E4=BF=AE=E5=A4=8D=E5=A4=9A?= =?UTF-8?q?=E5=A4=84=E8=BE=93=E5=85=A5=E6=A1=86=20IME=20=E5=90=88=E6=88=90?= =?UTF-8?q?=E6=9C=9F=E5=9B=9E=E8=BD=A6/Backspace=20=E8=AF=AF=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - file.vue 块模式文件重命名输入框 @on-keyup → @on-keydown, 避免拼音选词回车的 keyup 阶段误触发提交 - TagInput 回车添加 tag、Backspace 删除 tag 增加 IME 守卫 (isComposing / key=Process / keyCode=229),避免拼音选词回车 误加 tag、合成期 Backspace 误删上一个 tag - login / ProjectPanel / UserTagsModal / TaskAdd 的 @on-enter 改用 @on-keydown 包装 (keyCode===13),绕开 iview Input handleEnter 走 keyup.enter 在 IME 选词回车会误触发提交的问题 Co-Authored-By: Claude Opus 4.7 (1M context) --- resources/assets/js/components/TagInput.vue | 22 ++++++++++++------- resources/assets/js/pages/login.vue | 20 ++++++++++++----- .../pages/manage/components/ProjectPanel.vue | 8 ++++++- .../js/pages/manage/components/TaskAdd.vue | 8 ++++++- .../pages/manage/components/UserTagsModal.vue | 14 ++++++++++-- resources/assets/js/pages/manage/file.vue | 4 ++-- 6 files changed, 56 insertions(+), 20 deletions(-) diff --git a/resources/assets/js/components/TagInput.vue b/resources/assets/js/components/TagInput.vue index 4c65d3bcd..ce5119e6c 100755 --- a/resources/assets/js/components/TagInput.vue +++ b/resources/assets/js/components/TagInput.vue @@ -18,7 +18,7 @@ :placeholder="tis || placeholderText" :enterkeyhint="enterkeyhint" @keydown.enter="downEnter($event)" - @keydown.delete="delTag(false)" + @keydown.delete="onBackspace($event)" @keyup="onKeyup" @focus="onFocus" @blur="onBlur" @@ -195,7 +195,20 @@ this.addTag(false, content) }, downEnter(e) { + if (e.isComposing || e.key === 'Process' || e.keyCode === 229) { + return; + } e.preventDefault(); + this.addTag(e, this.content); + this.$nextTick(() => { + this.$emit("on-enter", e) + }) + }, + onBackspace(e) { + if (e.isComposing || e.key === 'Process' || e.keyCode === 229) { + return; + } + this.delTag(false); }, onFocus(e) { this.isFocus = true; @@ -207,14 +220,7 @@ this.$emit("on-blur", e) }, onKeyup(e) { - this.addTag(e, this.content); - // this.$emit("on-keyup", e) - if (e.keyCode === 13) { - this.$nextTick(() => { - this.$emit("on-enter", e) - }) - } }, addTag(e, content) { if (e === false || e.keyCode === 13) { diff --git a/resources/assets/js/pages/login.vue b/resources/assets/js/pages/login.vue index 08373d07c..fc0ff29c3 100644 --- a/resources/assets/js/pages/login.vue +++ b/resources/assets/js/pages/login.vue @@ -25,7 +25,9 @@ -