We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ea2533 commit bdf0286Copy full SHA for bdf0286
src/demo-app/autocomplete/autocomplete-demo.ts
@@ -88,8 +88,11 @@ export class AutocompleteDemo {
88
}
89
90
filterStates(val: string) {
91
- return val ? this.states.filter(s => new RegExp(`^${val}`, 'gi').test(s.name))
92
- : this.states;
93
- }
+ if (val) {
+ const filterValue = val.toLowerCase();
+ return this.states.filter(state => state.name.toLowerCase().startsWith(filterValue));
94
+ }
95
96
+ return this.states;
97
98
0 commit comments