-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
feat(native-filters): add option to create value in select filter #14314
feat(native-filters): add option to create value in select filter #14314
Conversation
8f43595
to
6f268c6
Compare
Codecov Report
@@ Coverage Diff @@
## master #14314 +/- ##
==========================================
- Coverage 76.93% 76.93% -0.01%
==========================================
Files 954 954
Lines 48075 48082 +7
Branches 5974 5976 +2
==========================================
+ Hits 36987 36991 +4
- Misses 10891 10894 +3
Partials 197 197
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
6f268c6
to
8bb466c
Compare
@@ -150,6 +155,9 @@ export default function PluginFilterSelect(props: PluginFilterSelectProps) { | |||
showSearch={showSearch} | |||
mode={multiSelect ? 'multiple' : undefined} | |||
placeholder={placeholderText} | |||
onSearch={val => setCurrentSuggestionSearch(val)} |
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.
onSearch={val => setCurrentSuggestionSearch(val)} | |
onSearch={setCurrentSuggestionSearch} |
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 catch 👍
@@ -163,6 +171,14 @@ export default function PluginFilterSelect(props: PluginFilterSelectProps) { | |||
</Option> | |||
); | |||
})} | |||
{currentSuggestionSearch && | |||
!(values || []).some( |
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.
WDYT about using ensureIsArray(values)
instead of values || []
? I'm not sure if it'd be easier to read, but maybe a bit safer in case values
is not an array
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.
Good idea 👍
…ache#14314) * feat(native-filters): add option to create value in select filter * address comments
SUMMARY
This is a port of #13029 to native filters to make it possible to add select filters that are not contained in the input data.
SCREENSHOTS
Single select filter:
Multiselect filter:
TEST PLAN
ADDITIONAL INFORMATION