Fixed clear button not showing when external input value is passed.#3497
Fixed clear button not showing when external input value is passed.#3497thompsongl merged 10 commits intoelastic:masterfrom
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.
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
displayValuewith a newinputValueprop.Before

After

Checklist
- [ ] Added documentation examples