-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Update: Disable font size when fit text is enabled and the opposite. #72533
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
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. |
|
Size Change: +67 B (0%) Total Size: 2.18 MB
ℹ️ View Unchanged
|
t-hamano
left a comment
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.
LGTM! Personally, I recommend shipping this PR to WP 6.9 as a temporary fix. I think a more ideal solution can be continued in #72492 if necessary.
f81a2b5 to
5600f54
Compare
|
It seems that this PR could not be automatically cherry-picked into the Normally, the bot would add a comment indicating that a conflict has occurred, but something is wrong with the CI itself. In any case, we'll need to create a manual backport PR against the |
…72533) Co-authored-by: jorgefilipecosta <[email protected]> Co-authored-by: t-hamano <[email protected]>
| const value = useMemo( | ||
| () => attributesToStyle( { style, fontFamily, fontSize } ), | ||
| [ style, fontSize, fontFamily ] | ||
| ); |
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.
Should fitText get memoized too?
|
No strong opinions, but personally I find it better when we do not update other attributes like this. I think that preserving the previous attribute is valuable when a user had a custom font size and just tries out fit text to see how it feels, and if they don't like it and disable it, they don't have to set again the previous font size. |
…2e tests (#72584) * Add end to end tests for Fit Text (#72406) Co-authored-by: jorgefilipecosta <[email protected]> Co-authored-by: mcsf <[email protected]> * Update: Disable font size when fit text is enabled and the opposite. (#72533) Co-authored-by: jorgefilipecosta <[email protected]> Co-authored-by: t-hamano <[email protected]> --------- Co-authored-by: jorgefilipecosta <[email protected]> Co-authored-by: mcsf <[email protected]>
|
Note that this PR has been manually backported to the |
I agree with this, but it probably requires introducing a new That's why I've proposed this approach in this PR as a fix for the 6.9 release. We can try a different approach in a follow-up if needed. |
Alternative to #72492.
This PR applies a suggestion by @t-hamano, it toggles off fit text when a font size is selected, and clears the font size selection when fit text is toggled on.
Testing Instructions
Verify the end to end tests pass.
Add a paragraph select a font size, enable fit text, verify the font size is removed.
Select a font size again verify fit text is removed.