Repository navigation
Components: Add disabled prop to CheckBoxControl - #69726
im3dabasia wants to merge 1 commit into
Conversation
|
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @mikeyarce. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
This feels valid to me, though perhaps the text should look disabled too? CC: @jameskoster @ciampo |
|
Agree it's valid, but I think we should avoid opacity if possible. We can potentially mimic the disabled styles in the
I'd probably say we should do that only if we're prepared to apply the same treatment across all controls. |
| @@ -27,6 +27,7 @@ const meta: Meta< typeof CheckboxControl > = { | |||
| control: false, | |||
| }, | |||
| help: { control: { type: 'text' } }, | |||
| disabled: { control: { type: 'boolean' } }, | |||
There was a problem hiding this comment.
No need to manually set this control, Storybook should infer it automatically from the types.
|
If we want to be consistent with base-ui (which will power next gen of components in the Do we think there is value in allowing checkboxes and other form controls to be focusable while disabled? cc @mirka |
I don't think I've run into a use case yet, so no immediate plans to do so. It's probably fine to not support |
|
Right, let's change the implementation to use |
|
Closing this out now since the original issue was closed already. Thanks! |
What?
Adds support for disabled state in
CheckboxControl.Closes #59411
Why?
Issue #59364 identified the need for a disabled state on
CheckboxControlfor better accessibility and user experience in forms.How?
aria-disabledis trueTesting Instructions
npm run storybook:devCheckboxControlcomponentScreencast
Screen.Recording.2025-03-27.at.3.23.01.PM.mov