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

[Toolbar ColorPicker] In the Toolbar in the Colorpicker the Colors are jumping between two hexCode colors #41088

Closed
Floriandrias96 opened this issue May 16, 2022 · 6 comments
Labels
[Package] Components /packages/components [Package] Format library /packages/format-library [Type] Bug An existing feature does not function as intended

Comments

@Floriandrias96
Copy link

Floriandrias96 commented May 16, 2022

Description

Feature ColorPicker in the Tollbar is not working as intended. I expext when I paste a hex Color in the ColorPicker to see the Color, but when you paste a Hex Color the ColorPicker jumps between the new and old Color instead. see gif: "Toolbar ColorPicker Jumping Bug".

Step-by-step reproduction instructions

  1. Open the Toolbar of a TextBlock (e.g. Paragraph).
  2. Click on "Displays more block tools.
  3. Click on "Highlight" but with no Text selected (works with Link or just Text) .
  4. Open CustomColor.
  5. Click on "Show detailed inputs".
  6. Paste a different Hexcolor into the inputfield that is curently used.

Screenshots, screen recording, code snippet

Toolbar ColorPicker Jumping Bug

Environment info

Wordpressversion: 5.9.3
Gutenbergversion: 12.9.0
Active Theme: Twenty Twenty-Two
Testet on Browser: Chrome, Firefox and Edge
Device: PC

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@ntsekouras ntsekouras added [Type] Bug An existing feature does not function as intended [Package] Format library /packages/format-library [Package] Components /packages/components labels May 18, 2022
@ntsekouras
Copy link
Contributor

This can be also reproduced by clicking backspace in the input for the custom color. It seems it might involve inner input components handling... --cc @ciampo @mirka

@ciampo
Copy link
Contributor

ciampo commented May 19, 2022

Thank you for the ping!

I can reproduce the issue as described by both @Floriandrias96 and @ntsekouras in the editor, however I was not able to reproduce it on the ColorPicker component in isolation.

I'll look a bit more into that and come back with any further discovery.

@ciampo
Copy link
Contributor

ciampo commented May 19, 2022

I also checked the ColorPalette component in isolation, and wasn't able to reproduce the issue.

The issue seems related to some sort of "infinite loop" where a new color value is not committed properly to whatever "state" is stored.

Next up, I would look at the InlineColorUI component, in particular at its "internal" ColorPicker and at its logic to set / get colors.

I'm really not familiar with this part of the codebase, and so it'd be great if someone with more familiarity could take a look as well.

It would also be interesting to find out when this bug introduced — it may give further hints to what's causing it.

@ciampo
Copy link
Contributor

ciampo commented Apr 5, 2023

Hey @Floriandrias96 and @ntsekouras , I took another quick look and couldn't reproduce this issue on latest trunk (i.e. the flashing between two different colors in the color picker).

In case you can't reproduce it either, we can close this issue.

@ntsekouras
Copy link
Contributor

I couldn't reproduce either.. Let's close for now and feel free to reopen if someone can reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Package] Format library /packages/format-library [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants