-
Notifications
You must be signed in to change notification settings - Fork 384
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
Fix displaying font family in the editor #2831
Conversation
Thanks for providing such a quick fix! Seems like quite a few selectors to remove. I'll try to dome some in-depth testing to see whether this causes any other issues. Also, note to self that we could add some E2E test for the font family selection feature. |
It looked like
Thanks, tried to test it myself, too, always good to have someone else testing though.
Yep, would be good to take the e2e tests into the dev process, I'm def happy to add some tests post-merge, also for the existing stuff. If I understand correctly then you already started within #2708. |
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.
Hopefully works now. Tested the following:
|
Looks better now. Sorry for hijacking your PR, but I felt like this is a good opportunity to fix the block dimension and font size calculation. See 1187d73. Because right now font family changes are not being considered in these cases. There's only one problem at the moment:
Not sure why that is at the moment. I thought #2809 would fix that? |
Actually, when browsing the frontend in a 328x553 view, it looks the same. Just not in something like a 375x812 view. |
Then it should be OK, since the values are in % then we can't really control it beyond ensuring it looks the same with the same width/height. |
Cool. If you can test my change too that would be excellent. Then we can merge and send it to QA. |
} = attributes; | ||
|
||
const checkFontSize = ( | ||
const checkFontSize = ampFitText && ( |
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.
^ This check is actually already within maybeUpdateFontSize
but I guess it doesn't harm to have it here + makes it more clear/readable, too.
Seems to work well most of the time. For some reason, sometimes with amp-fit-text it doesn't work properly, not sure why. Did the following:
Note that this happened maybe once in clicking through the whole set of fonts so it's not something really easy to debug, we can probably look into this later if it should appear more, let's merge this. |
Also found this issue: #2839 Testing shows that happens on |
I think this might be a race condition when the font stylesheet hasn't loaded yet, so the calculation does nothing because the font hasn't been applied. |
I think it's an easy fix. Let me push something really quick. |
f2e7a5e also fixes a bug where a text block with turned off fit-text does not resize when writing a long text. With this change, the story title block correctly changes font size or dimensions during typing of a very long title. |
LGTM! |
Fixes #2828.
Fixes #2838.
Fixes #2839.