-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
fix(select): render when empty multiselect #19612
Conversation
341892b
to
a313eb4
Compare
a313eb4
to
c16c534
Compare
Codecov Report
@@ Coverage Diff @@
## master #19612 +/- ##
==========================================
- Coverage 66.68% 66.53% -0.16%
==========================================
Files 1681 1681
Lines 64316 64319 +3
Branches 6565 6564 -1
==========================================
- Hits 42888 42793 -95
- Misses 19733 19853 +120
+ Partials 1695 1673 -22
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
* fix(select): render when empty multiselect * disable flaky test (cherry picked from commit 1ad82af)
* fix(select): render when empty multiselect * disable flaky test
SUMMARY
PR #19341 introduced a regression that caused the adhoc filter value selector to disappear if a multioperator (IN, NOT IN) was chosen and there were no options. It is typical for the options to be missing if the "populate autocomplete filters options" option has been disabled in the dataset properties. I believe the reason for the bug that #19341 attempted to address was due to only checking if a selected item was
typeof 'object'
. This istrue
fornull
, which caused the logic to assume the value was in fact aLabeledValue
(=object with keysvalue
andlabel
). Here we introduce a typeguard to make the checking even more robust, and remove the logic that delays rendering ofSelectWithLabel
.I checked that the original issue that #19341 set out to fix still works after this change. However, deselecting a NULL value doesn't seem to work properly if there are other falsy values (for this we'll need to use
LabeledValue
and use a customkey
as do make sure each entry is unique). However, I consider this a separate issue which should be addressed in the native filter, so will address that in a separate PR.AFTER
Now the dropdown renders correctly:
filter-after.mp4
BEFORE
Previously the dropdown disappeared if there were no options:
filter-before2.mp4
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION