Skip to content

Conversation

@Sidsector9
Copy link
Contributor

@Sidsector9 Sidsector9 commented Aug 30, 2024

Closes #64921

What?

  • When onClose is not set, the search icon is always shown (for empty and non-empty field)
  • When onClose is set, then the close icon is shown when the field is not empty, and search icon is shown when the field is empty.

Why?

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.

How?

Nothing very complex. Just modifies basic if-else logic

Testing Instructions

Testing Instructions for Keyboard

Screenshots or screencast

@Sidsector9 Sidsector9 requested a review from ajitbohra as a code owner August 30, 2024 09:27
@github-actions
Copy link

github-actions bot commented Aug 30, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Sidsector9 <nomnom99@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@bph bph added the [Feature] UI Components Impacts or related to the UI component system label Sep 10, 2024
@mirka mirka requested a review from a team September 11, 2024 20:50
@mirka mirka added [Type] Bug An existing feature does not function as intended [Package] Components /packages/components and removed [Feature] UI Components Impacts or related to the UI component system labels Sep 11, 2024
@mirka
Copy link
Member

mirka commented Sep 11, 2024

Attempting to clarify intended behavior in #64921 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Components /packages/components [Type] Bug An existing feature does not function as intended

Projects

Status: Inbox (needs triage) 📬

Development

Successfully merging this pull request may close these issues.

SearchControl always shows the close icon when onClose prop is set

3 participants