-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Custom color picker in the paragraph block closing prematurely #21163
Comments
As far as I can track down, when a color is selected from the color picker, something in the editor is stealing focus from the color picker, causing the dropdown to think it has been blurred, and thus, closing the color picker. |
The component structure looks like this:
The When the When the focus is stolen, the I see there are 2 ways around this: 1. Fix the TextColor wrapper component by ensuring it doesn't recreate the I haven't look deeper into 2. Introduce an option to disable close on focus on While it is nice to have this option, I predict the logic around deciding when the color picker dropdown should stay open, and when it shouldn't, could be tricky/dirty as well. |
@ellatrix Would you be able to take a look at this or offer a few pointers as I see you've got your fingerprints all over this in the commit history? |
I see somehow RichText is setting focus back, which shouldn't be happening. |
Actually, this has nothing to do with RichText. The problem is that the |
@jorgefilipecosta Any idea how we could avoid the color components remounting its children? |
#21037 fixes this issue. |
I'm not totally familiar with how the hook works but given that #21037 fixes the issue and that is the new approach we are trying I guess we should try to merge that PR instead of trying a fix for this in useColors. |
Describe the bug
When clicking on the (hue selector?) part of the custom color picker, the color picker is closed prematurely:
To reproduce
Steps to reproduce the behavior:
Expected behavior
The custom color picker is closed
Additional context
The text was updated successfully, but these errors were encountered: