-
Notifications
You must be signed in to change notification settings - Fork 11
feat: update combo-box to account for 'create new' autocomplete use cases #854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## main #854 +/- ##
==========================================
- Coverage 85.47% 85.47% -0.01%
==========================================
Files 796 797 +1
Lines 16310 16351 +41
Branches 1940 1955 +15
==========================================
+ Hits 13941 13976 +35
- Misses 2337 2343 +6
Partials 32 32
Continue to review full report at Codecov.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
private setFilteredOptions(text?: string): void { | ||
this.filteredOptions = (this.options ?? []).filter(option => text === undefined || option.text.includes(text)); | ||
this.filteredOptions = (this.options ?? []).filter( | ||
option => text === undefined || option.text.toLowerCase().includes(text.toLowerCase()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if text is undefined then we don't need to call filter.
private setFilteredOptions(text?: string): void { | ||
this.filteredOptions = (this.options ?? []).filter(option => text === undefined || option.text.includes(text)); | ||
this.filteredOptions = (this.options ?? []).filter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we call it searchText
?
} | ||
|
||
this.scrollIntoViewService.scrollIntoView(this.optionElements.get(this.highlightedOptionIndex)?.nativeElement); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Is it this easy to scroll and show a particular element in the view? I can use it at so many other places now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep! Just this easy.
This comment has been minimized.
This comment has been minimized.
Unit Test Results 4 files 252 suites 14m 54s ⏱️ Results for commit 6fc0297. |
Description
This adds the ability to "Create new" value using combo-box autocomplete.