-
Notifications
You must be signed in to change notification settings - Fork 4.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
Fixed search for invalid label and/or value #2179
Fixed search for invalid label and/or value #2179
Conversation
src/utils/defaultFilterOptions.js
Outdated
var value = option[props.valueKey]; | ||
var label = option[props.labelKey]; | ||
var hasValue = typeof (value) !== 'undefined' && value !== null && value !== ''; | ||
var hasLabel = typeof (label) !== 'undefined' && label !== null && label !== ''; |
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.
Maybe extract this logic into a function?
} | ||
|
||
var valueTest = hasValue ? String(value) : null; | ||
var labelTest = hasLabel ? String(label) : null; |
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.
Why not include this in the hasX checks?
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.
It's because there is situation when only one of label or value is invalid and still need to search in valid field.
Thanks for this @yuri-sakharov! Great PR 👍 |
@JedWatson thank you too. |
We have a results in dropdown if user search "undefined" word when value and/or label are undefined or if search "null" word when value and/or label are null.