-
Notifications
You must be signed in to change notification settings - Fork 842
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 clear button not showing when external input value is passed. #3497
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
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.
We want to keep the ability of EuiFieldSearch to be an uncontrolled component, which means allowing consumers the option to provide defaultValue
rather than value
.
The code as it was was almost correct, but it needs to check props.value
as well as the value
of the actual input
element here:
(https://github.com/elastic/eui/pull/3497/files#diff-8b595829e37edfabf542f269c6d7036aL222-L223)
I think it could be done using the ref
I tried this method but it was not working in case of the initial render as the input element doesn't have a value. |
@thompsongl Thanks for the suggestion. Updated changes 👍 |
Thanks, @ashikmeerankutty. I'm going to do some more manual testing with this to make sure side effects were introduced. |
jenkins test this |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3497/ |
jenkins test this |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3497/ |
Summary
Fixes #3488
Replaced usage of
displayValue
with a newinputValue
prop.Before
After
Checklist
- [ ] Added documentation examples