NG-ZORRO / ng-zorro-antd

Angular UI Component Library based on Ant Design
https://ng.ant.design
MIT License
8.87k stars 3.93k forks source link

`TreeSelect` need a debounce for `inputValue` #7876

Open MQpeng opened 1 year ago

MQpeng commented 1 year ago

What problem does this feature solve?

  1. Restrict the calling of the handleSearchValue function in tree.component.ts frequently
  2. User input can cause bad performance
  3. There is a demo in official code(https://stackblitz.com/run?file=src%2Fapp%2Fapp.component.ts)

What does the proposed API look like?


// components/tree-select/tree-select.component.ts
setInputValue(value: string): void {
    this.inputValue = value;
    this.updatePosition();
 }
// change to 
setInputValue(value: string): void {
    this.inputValue.next(value)
}
```<!-- generated by ng-zorro-issue-helper. DO NOT REMOVE -->
MQpeng commented 1 year ago

There is a demo in official code(https://stackblitz.com/edit/angular-hgx1np?file=src/app/app.component.ts)