mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-13 12:02:51 +00:00
fix: 修复用户选择在输入法预输入时误删已选项
This commit is contained in:
parent
e8235dd0a2
commit
0b99b4a9a0
@ -901,11 +901,17 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onKeydown(event) {
|
onKeydown(event) {
|
||||||
|
if (event.isComposing || event.key === 'Process') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// 按下删除键时,判断是否符合删除条件
|
// 按下删除键时,判断是否符合删除条件
|
||||||
this.backspaceDelete = event.key === 'Backspace' && !this.searchKey && this.selects.length > 0;
|
this.backspaceDelete = event.key === 'Backspace' && !this.searchKey && this.selects.length > 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
onKeyup(event) {
|
onKeyup(event) {
|
||||||
|
if (event.isComposing || event.key === 'Process') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (event.key === 'Backspace' && this.backspaceDelete) {
|
if (event.key === 'Backspace' && this.backspaceDelete) {
|
||||||
// 从最后一个元素开始向前遍历,找到第一个不是不可取消的元素
|
// 从最后一个元素开始向前遍历,找到第一个不是不可取消的元素
|
||||||
for (let i = this.selects.length - 1; i >= 0; i--) {
|
for (let i = this.selects.length - 1; i >= 0; i--) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user