-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TimePicker: use ToggleGroupControl for AM/PM toggle #64800
TimePicker: use ToggleGroupControl for AM/PM toggle #64800
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: @MadGanGithub. 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 🚀
packages/components/CHANGELOG.md
Outdated
@@ -9,6 +9,7 @@ | |||
### Enhancements | |||
|
|||
- `ColorPicker`: Adopt radius scale ([#64693](https://github.com/WordPress/gutenberg/pull/64693)). | |||
- `TimePicker`: use ToggleGroupControl for AM/PM toggle ([#64800](https://github.com/WordPress/gutenberg/pull/64800)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can frame this as a full-on bug fix since it was previously inaccessible.
> | ||
<Button | ||
<ToggleGroupControlOption | ||
className="components-datetime__time-am-button" // Unused, for backwards compatibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we can remove this className
now? I can't really imagine a style override that was applied on the previous implementation that would still work as intended in the new implementation 😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The components-datetime__time-field
is actually used in more places throughout the component, but for the scope of this PR I've only removed it from ToggleGroupControl
.
If you think it makes sense, I can open a follow-up removing those other instances too.
39b1f5e
to
4fdb477
Compare
* TimePicker: use ToggleGroupControl instead of ButtonGroup * Update unit tests * CHANGELOG * Move changelog entry to bug fixes * Removed legacy classnames --- Unlinked contributors: MadGanGithub. Co-authored-by: ciampo <[email protected]> Co-authored-by: mirka <[email protected]> Co-authored-by: jasmussen <[email protected]> Co-authored-by: jameskoster <[email protected]> Co-authored-by: patil-vipul <[email protected]>
@MadGanGithub mind sharing your WordPress.org username so I can ensure its included in the 6.7 credits listing? |
What?
Closes #61163
Use
ToggleGroupControl
inTimePicker
instead of buttonWhy?
For better semantics and screen readers support (
ToggleGroupControl
implementsradio
semantics)How?
ButtonGroup
andButton
forToggleGroupControl
andToggleGroupControlOption
;onChange
callback instead ofonClick
handlersTesting Instructions
is12Hour
prop istrue
)Screenshots or screencast