-
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
Stop displaying FontSizePicker dropdown when there are no fonts. #13782
Stop displaying FontSizePicker dropdown when there are no fonts. #13782
Conversation
@Naerriel What was the PHP you used to set the font sizes to empty? |
…fix/font-picker-present-with-no-fonts
@chrisvanpatten Excellent question. I haven't used the PHP, I set it in JS. Possible solutions:
I'm not sure if I have got the call to action reached in #11628 correctly as well. What do you think? |
@Naerriel we do have a PHP function for pre-defining the dropdown sizes, |
@chrisvanpatten Yes, when you asked your question, I tried to do it in several ways but none worked. I can patch this behaviour in the core, but I don't think people will use it. If you think that this should be done, I can get my hands on that 😄 |
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.
Thank you for your contribution @Naerriel and thank you for reviewing @chrisvanpatten 👍
It should be possible to use add_theme_support( 'editor-font-sizes', array() )
;. But there is a bug that is affecting this change. I will open a follow-up PR to address this problem.
The change in this PR makes total sense and fixes a bug where the dropdown renders incorrectly so independently of the other bug so I'm going to merge it and then we can continue the iteration.
@jorgefilipecosta Are you able to link to your pull/issue relating to the fix preventing This issue was closed, however the original problem still exists. |
…re are no fonts. (#13782)
…re are no fonts. (#13782)
Description
Closes #11628.
The FontSizePicker currently displays a dropdown with fonts, even when there are no fonts.
This change stops displaying the dropdown in this case.
How has this been tested?
In
packages/components/src/font-size-picker/index.js
I overwrotefontSizes
to[]
and the dropdown would not display anymore.Ran
npm run test
and see that all tests passes.Screenshots
Types of changes
Bug fix.
Checklist: