-
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
Contrast Checker only works after changing colors the second time #60825
Comments
After some initial debugging, it appears the ContrastChcker does not (always) receive the changed colors. See attached GIF, while dumping to the console the colors at the top of the file in the ContrastChcker. |
Note to myself and to everyone willing to help on this issue. The Some blocks, e.g. Social links, use As far as I can tell, it appears it's a matter of timing, as the color detection sometimes happens before the actual color change. That is: See attached screenshot, where I'm dumping the detected text color, and dumping it again within a
debug-contrast-checker.diff.txt To debug:
|
I can't figure out how to make sure the color detection is guaranteed to happen after a color change. I spent a considerable amount of time debugging this issue but I'm afraid it goes beyond my coding abilities. I would appreciate someone else more familiar with hooks to step in and help this issue move on. |
Closing in favor of #67035. I can no longer reproduce the bug due to different regressions. Details: #67035 (comment). |
Description
Discovered while exploring #58936 (comment)
It appears the Contrast Checker is buggy and only works when changing one more time a color setting. This happens both when setting an insufficient color pair *the notice should appear) and when setting a sufficient one (the notice should disappear).
See attached animated GIF.
The Contrast Checker is an important feature that should work 'out of the box' for all color settings that apply to text and background. Since WordPress 6.6 is supposed to be a 'bug fixes' release, I'd like to propose to fix the Contrast Checker and make it work reliably for 6.6. Some e2e tests would be nice.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
No response
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
The text was updated successfully, but these errors were encountered: