Skip to content

Commit 07a1f5e

Browse files
authored
fix(module:tree-select): 修复节点为禁用状态时,back快捷键能删除bug (#8105)
* fix: 修复节点为禁用状态时,back快捷键能删除bug * fix: 当input处于组合时,不应该进行搜索
1 parent 2ee261a commit 07a1f5e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

components/tree-select/tree-select.component.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,9 @@ export class NzTreeSelectComponent extends NzTreeBase implements ControlValueAcc
545545
e.preventDefault();
546546
if (this.selectedNodes.length) {
547547
const removeNode = this.selectedNodes[this.selectedNodes.length - 1];
548-
this.removeSelected(removeNode);
548+
if (removeNode && !removeNode.isDisabled) {
549+
this.removeSelected(removeNode);
550+
}
549551
}
550552
}
551553
}
@@ -556,8 +558,10 @@ export class NzTreeSelectComponent extends NzTreeBase implements ControlValueAcc
556558
}
557559

558560
setInputValue(value: string): void {
559-
this.inputValue = value;
560-
this.updatePosition();
561+
if (!this.isComposing) {
562+
this.inputValue = value;
563+
this.updatePosition();
564+
}
561565
}
562566

563567
removeSelected(node: NzTreeNode, emit: boolean = true): void {

0 commit comments

Comments
 (0)