-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Tabs and ToggleGroupControl: round indicator size #66426
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 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.
I tested and this fixes the issue.
I was curious if this might be a candidate for 6.7 but I can’t reproduce the issue on 6.7 RC1. That’s a bit of a curiosity since at least some of the recent Tabs
updates seem to have landed there. I mostly mention that as something that could be investigated to figure out precisely why the issue is in trunk and not there. The unrounded values seem to be present in 6.7 yet not producing this issue.
Anyway, this seems like a solid fix especially because all property values are floor
’d.
It almost feels like it could be a string type so it could be specified to either |
Thank you for the review! This can't be reproduced in 6.7 because not all recent Re. the rounding options and variable name, you have a point — but I think that the current solution is good enough for the time being, and I don't anticipate a need for more nuance (if anything, we may want to remove the option and always |
I realized I never added a link in my previous message — this is the conversation with a detailed list of what |
Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: stokesman <presstoke@git.wordpress.org> Co-authored-by: DaniGuardiola <daniguardiola@git.wordpress.org>
What?
Fixes #66347
This PR adds rounding to the
Tabs
andToggleGroupControl
's indicatorsWhy?
As demonstrated in #66347, the indicator can sometimes cause scrolling in its container (eg. tablist) in an unreliable way, caused by subpixel rendering.
How?
roundRect
option to theuseAnimatedOffsetRect
hook which appliesMath.floor
to the rect measurements;Tabs
andToggleGroupControl
componentsTesting Instructions
Follow instructions from #66347, make sure the issue can't be reproduced while applying changes from this PR.
Screenshots or screencast
Kapture.2024-10-24.at.17.15.21.mp4