WordPress / gutenberg

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

ToggleGroupControl: Add disabled state #57862

Open mirka opened 9 months ago

mirka commented 9 months ago

What problem does this address?

57562 surfaced a use case for a disabled state for ToggleGroupControl.

What is your proposed solution?

ciampo commented 9 months ago

we may need an additional focusableWhenDisabled prop on ToggleGroupControl so consumers can choose.

We should probably keep an eye on the final decision made in https://github.com/WordPress/gutenberg/issues/56547, so that we can ensure consistency in the prop naming and (potentially) default behaivior

mirka commented 3 months ago

@ciampo I accidentally confounded the two at first too, but this issue is for a disabled state on the entire component, not the individual options. This was the use case in BorderControl (#57562), where ideally I wanted to disable the entire ToggleGroupControl and maybe show a tooltip to explain why it was disabled.

ciampo commented 3 months ago

Got it! Let me know if you think it's worth working on it soon, while we're still fresh from other ToggleGroupControl work