Description
The SearchControl component has an icon suffix to show a magnifying lens or the close icon conditionally.
But when the onClose prop is set, the lens icon is never shown, and the close icon is always shown.
Step-by-step reproduction instructions
<SearchControl
value={ text }
onChange={ setText }
onClose={ () => {} } // comment and uncomment this line to observe the bug.
/>
Expected behavior
- When
onClose is not set, the search icon should be always shown (for empty and non-empty field)
- When
onClose is set, then the close icon should be shown when the field is not empty, and search icon should be shown when the field is empty.
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Description
The
SearchControlcomponent has an icon suffix to show a magnifying lens or the close icon conditionally.But when the
onCloseprop is set, the lens icon is never shown, and the close icon is always shown.Step-by-step reproduction instructions
Expected behavior
onCloseis not set, the search icon should be always shown (for empty and non-empty field)onCloseis set, then the close icon should be shown when the field is not empty, and search icon should be shown when the field is empty.Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.