-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Fit text: Remove sizing limitation when the block is selected. #72570
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
Fit text: Remove sizing limitation when the block is selected. #72570
Conversation
|
Size Change: -71 B (0%) Total Size: 2.19 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 3e56a64. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/18714165154
|
|
Thanks for following up here. I'm OK with merging, but this PR highlights a preëxisting problem: at least on my computer, regardless of browser, the size calculation results in the three initial keypresses ("abc") not quite fitting: fit-text-oversize.movIt's not exactly that they don't fit the screen. They do fit, but only if you scroll slightly. The problem seems related to the height of the caret itself, which is always re-centred in the viewport on each keypress. Thoughts, @jorgefilipecosta? |
|
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. |
|
The other thing is totally unrelated to this PR, but I'd still like us to track and see if we can improve: fit-text-flash.movI'd love it if we could hide the flash that happens during the binary search for optimal size. In the video above it happens with the empty-block placeholder, but of course this also applies to actual text. |
mcsf
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.
👍 Up to you whether to merge it right away and address the follow-up comment (the one about caret height) separately, or in here.
3e56a64 to
4c4c894
Compare
Co-authored-by: jorgefilipecosta <[email protected]> Co-authored-by: mcsf <[email protected]>
|
Hi @mcsf thank you a lot for the review and testing 👍
The first issue, although not ideal, seems to be the expected behavior. The paragraph is directly inside content, and the content area has no height restrictions (it can grow indefinitely, the scroll happens on the container of the content / iframe but the content height itself grows, so in that scenario fit text is only limited by the width, so regarding the height scroll may happen or not depending on the window size as the images below show:
That flashing is something we can try to improve, maybe with hiding during the binary search or something similar. |
|
I just cherry-picked this PR to the wp/6.9 branch to get it included in the next release: 8c352e7 |


Some users thought that having a different font size for fit text when the block is selected vs unselected was a bug. So we are reverting this change as a way to simplify, and receive feedback on the simple version without any restriction.
Testing Instructions
Add a paragraph, type some character like "A".
Enable fit text
Unselect the block and select it again verify the font size does not changes.