WordPress / gutenberg

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

Deprecate ButtonGroup component #65338

Open mirka opened 5 days ago

mirka commented 5 days ago

What problem does this address?

The component does two things:

As we can see from the usages in the Gutenberg app, role="group" is not semantically sufficient to make these buttons behave like a segmented control, and most consumers will not realize this. As such, most of our in-repo usages are inaccessible.

The outdated segmented control style is similar to the already deprecated RadioGroup, and is succeeded by the ToggleGroupControl style.

What is your proposed solution?

Consumers who want to wrap their buttons in a group can do that with a plain <div role="group">.

hbhalodia commented 1 day ago

Hi @mirka, I have raised the PR by adding the soft deprecation as expected on the issue. Let me know if we need to update anything else in the PR - https://github.com/WordPress/gutenberg/pull/65429

Thank You,