Skip to content

Commit

Permalink
fix(module:tree-select): 修复节点为禁用状态时,back快捷键能删除bug (#8105)
Browse files Browse the repository at this point in the history
* fix: 修复节点为禁用状态时,back快捷键能删除bug

* fix: 当input处于组合时,不应该进行搜索
  • Loading branch information
EnochGao committed Oct 19, 2023
1 parent 2ee261a commit 07a1f5e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions components/tree-select/tree-select.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,9 @@ export class NzTreeSelectComponent extends NzTreeBase implements ControlValueAcc
e.preventDefault();
if (this.selectedNodes.length) {
const removeNode = this.selectedNodes[this.selectedNodes.length - 1];
this.removeSelected(removeNode);
if (removeNode && !removeNode.isDisabled) {
this.removeSelected(removeNode);
}
}
}
}
Expand All @@ -556,8 +558,10 @@ export class NzTreeSelectComponent extends NzTreeBase implements ControlValueAcc
}

setInputValue(value: string): void {
this.inputValue = value;
this.updatePosition();
if (!this.isComposing) {
this.inputValue = value;
this.updatePosition();
}
}

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

0 comments on commit 07a1f5e

Please sign in to comment.