WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.35k stars 4.13k forks source link

SearchControl: Deprecate `onClose` prop #65334

Open mirka opened 1 week ago

mirka commented 1 week ago

What problem does this address?

The onClose prop is not used anymore in the Gutenberg app. It was originally intended to render a close button to "trigger your own logic to close the search field entirely, rather than just clearing the input value."

The prop itself is causing confusion to consumers (#64921), and I think the UI pattern of a single button that doubles as a reset and a close is questionable from a UX standpoint.

What is your proposed solution?

I think we can soft deprecate the feature. For consumers that really want to maintain the original behavior, however unrecommended, we can issue guidance to use the suffix prop.

ciampo commented 13 hours ago

we can issue guidance to use the suffix prop.

Agreed. We could add a dedicated Storybook example too