carbon icon indicating copy to clipboard operation
carbon copied to clipboard

Search: clearing a Search component with `searchButton` prop via the text input's clear button should "click" the Search button

Open damienrobson-sage opened this issue 8 months ago • 1 comments

Description

If I'm using Search with searchButton set, I want to fire another search if a user clicks the clear button in the text input. I want the button so that I don't have to debounce anything, but then it feels like onChange would need several conditions to ignore most activity, and pressing clear and then Search again feels inefficient for what I'm expecting (I've cleared my search condition, so surely that would reset my data?).

Suggested solution

When clear is pressed, also pseudo-click the Search button to "clear the filter" and not just the text input.

Demo URL

https://carbon.sage.com/?path=/docs/search--docs

Alternatives

No response

Additional context

No response

Confidentiality

  • [X] I confirm there is no confidential or commercially sensitive information included.

damienrobson-sage avatar Jun 07 '24 13:06 damienrobson-sage