-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
Implement emptyText
and emptyValue
in AutocompleteInput
#8162
Conversation
SelectInput
and AutocompleteInput
emptyValue
and emptyText
prop from AutocompleteInput
We need to keep |
emptyValue
and emptyText
prop from AutocompleteInput
emptyText
in AutocompleteInput
Co-authored-by: Jean-Baptiste Kaiser <jb@marmelab.com>
@@ -458,8 +490,7 @@ If you provided a React element for the optionText prop, you must also provide t | |||
]); | |||
|
|||
const isOptionEqualToValue = (option, value) => { | |||
// eslint-disable-next-line eqeqeq | |||
return getChoiceValue(option) == getChoiceValue(value); | |||
return getChoiceValue(option) === getChoiceValue(value); |
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.
This change fixes a test
@@ -342,6 +368,12 @@ If you provided a React element for the optionText prop, you must also provide t | |||
return option?.name; | |||
} | |||
|
|||
if (!isListItem && option[optionValue || 'id'] === emptyValue) { |
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.
This change prevents the empty choice from getting processed by getRecordRepresentation
when isFromReference
is true
fixing the e2e test
Co-authored-by: Jean-Baptiste Kaiser <jb@marmelab.com>
Fixes #8091
emptyText
usageemptyValue
with no support fornull
orundefined
SelectInput
'semptyValue
docs