Skip to content
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

RichText Text Color formatting option still available with empty color palette #20205

Closed
dougwollison opened this issue Feb 13, 2020 · 0 comments · Fixed by #20222
Closed

RichText Text Color formatting option still available with empty color palette #20205

dougwollison opened this issue Feb 13, 2020 · 0 comments · Fixed by #20222
Assignees
Labels
[Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@dougwollison
Copy link
Contributor

Describe the bug
In version 7.5, if I "register" an empty color palette and "disable-custom-colors" via add_theme_support, the new Text Color formatting option added by #16014 will still show, with an empty popover.

To reproduce
Steps to reproduce the behavior:

  1. Add the following code to your theme's after_theme_setup hook:
add_theme_support( 'editor-color-palette', array() );
add_theme_support( 'disable-custom-colors' );
  1. Open the editor and highlight some text, then open the Formats flyout; the Text Color option will still be present.
  2. Click on the Text Color option, it will present you with an empty color palette popover with just a clear button.

Expected behavior
The Text Color option should be removed entirely. I can work around this via unregisterFormatType, but it should not be necessary and instead follow the pattern now present in the "Background & Text Color" panel on paragraphs/buttons/etc when no preset or custom colors/gradients are available.

Screenshots
screenshot of empty popover

Additional context

  • Using the Gutenberg 7.5.0 plugin
@jorgefilipecosta jorgefilipecosta added the [Type] Bug An existing feature does not function as intended label Feb 13, 2020
@jorgefilipecosta jorgefilipecosta self-assigned this Feb 13, 2020
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants