Skip to content

Commit 0755c21

Browse files
authored
feat: support dynamic options loading on filtering (#212)
1 parent 3c369a4 commit 0755c21

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.changeset/breezy-weeks-collect.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@alauda/ui": patch
3+
---
4+
5+
feat: support dynamic options loading on filtering

src/select/base-select.ts

+10
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
refCount,
2121
startWith,
2222
switchMap,
23+
takeUntil,
2324
} from 'rxjs/operators';
2425

2526
import { CommonFormControl } from '../form/public-api';
@@ -239,6 +240,15 @@ export abstract class BaseSelect<T, V = T>
239240
refCount(),
240241
);
241242

243+
// support dynamic options loading on filtering
244+
this.allOptions$.pipe(takeUntil(this.destroy$$)).subscribe(() => {
245+
if (this.opened) {
246+
requestAnimationFrame(() => {
247+
this.autoFocusFirstOption();
248+
});
249+
}
250+
});
251+
242252
this.hasMatchedOption$ = combineLatest([
243253
this.allOptions$.pipe(
244254
map(customOptions =>

0 commit comments

Comments
 (0)