You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EuiSuperSelect inputDisplay Does not support falsey values #7359
Describe the bug
for EuiSuperSelect, if the option values are falsey, then the valueOfSelected prop will not properly display the label when the falsey option is selected
EUI version 76.0.0 (Though I believe it impacts the latest version as well):
React version:
Kibana version (if applicable):
Browser:
Operating System:
Expected behavior
A selected option of false would still render the display label for the super select
Minimum reproducible sandbox
It is extremely helpful for us if you are able to reproduce your issue in a minimum reproducible sandbox (visit our docs site and click the CodeSandbox logo in the top-right corner).
Additional context
I believe the source is located here. We are guarding against an undefined selectedOption, but that is too broad and will filter out false as well
changed the title [-]EuiSuperSelect Does not support `falsey` values[/-][+]EuiSuperSelect `inputDisplay` Does not support `falsey` values[/+]on Nov 14, 2023
Not sure if you're using Typescript for your project, but I noticed typing values to be non-strings was also broken - that should also be fixed now, allowing you to do, e.g. <EuiSuperSelect<boolean> valueOfSelected={false} />
robert-seymour-numerated commented on Nov 14, 2023
Activity
[-]EuiSuperSelect Does not support `falsey` values[/-][+]EuiSuperSelect `inputDisplay` Does not support `falsey` values[/+]cee-chen commentedon Nov 14, 2023
Great catch on this @robert-seymour-numerated! We should have a fix next week for this in #7362.
Not sure if you're using Typescript for your project, but I noticed typing values to be non-strings was also broken - that should also be fixed now, allowing you to do, e.g.
<EuiSuperSelect<boolean> valueOfSelected={false} />robert-seymour-numerated commentedon Nov 14, 2023
@cee-chen You are the best, thanks! We do use Typescript, and I'll take a look at the generic fixes for our project.