Cascader: fix an error issure (#22313)

pull/22314/head
chenyang 2022-12-13 15:54:06 +08:00
parent fa18776b4b
commit c83968258e
1 changed files with 8 additions and 6 deletions

View File

@ -594,7 +594,7 @@ export default {
const lastTag = presentTags[lastIndex];
this.pressDeleteCount = inputValue ? 0 : pressDeleteCount + 1;
if (!lastTag) return;
if (!lastTag || lastTag.key === -1) return;
if (this.pressDeleteCount) {
if (lastTag.hitState) {
@ -618,11 +618,13 @@ export default {
}
},
deleteTag(tag) {
if (tag.node) {
const { checkedValue } = this;
const current = tag.node.getValueByOption();
const val = checkedValue.find(n => isEqual(n, current));
this.checkedValue = checkedValue.filter(n => !isEqual(n, current));
this.$emit('remove-tag', val);
}
},
updateStyle() {
const { $el, inputInitialHeight } = this;