-
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
Toolbar showing for TextControl when RichText is not selected #7463
Comments
Thanks for reporting. So as you noticed, we tried to automate also unfocusing There is also a different but related issue to this one:
We just need to better understand what would be the best way to tackle all those flows plugin developers would like to have. |
I can confirm, it's still an issue. |
With Gutenberg 5.8 and the last version of WordPress, the problem is still happening. |
Just discovered this, closing my duplicate - #16651 This is very easily tested in the Search block, which has a RichText and a TextArea. |
The root cause is that unless gutenberg/packages/block-editor/src/components/rich-text/index.js Lines 137 to 141 in 0446ed1
gutenberg/packages/block-editor/src/components/rich-text/index.js Lines 548 to 553 in 0446ed1
When you select the rich text first, and then switch to the input, the block remains selected so the buttons don't disappear. I looked up why is it not an issue in e.g. the image block where the caption is also RichText, and there's some custom code in place to override the value of gutenberg/packages/block-library/src/image/edit.js Lines 686 to 696 in 0446ed1
One idea would be to check focus instead (or in addition to isSelected). |
A quick experiment confirms it would work: An experimental branch available here: It's not clean mergable code and requires some more care (like analyzing why |
Can we get an update from someone on this issue? |
@paaljoachim Have you tested to see if it's still an issue? |
@talldan I have tested it again with WordPress 5.6 and Gutenberg 10.0 snd can confirm this is still an issue. |
Thanks @grappler. |
@grappler, this seems to be resolved in 5.8 with Gutenberg plugin 11.3.0: |
Tested with WordPress 5.8 and it works as expected. Closing... |
Follow the test method descriped in Issue #16651 as the test case involved a core block.
I have created a block with both TextControl and RichText.
When I select the RichText I get the toolbar but the toolbar does not disappear when the TextControl is selected. I have tested this with Gutenberg 3.1
Here is a screenshot of the block with the TextControl and RichText.
I have created a example plugin where this can be tested: grappler-block.zip
The code it the
edit
isThis was previously working with a custom
onFocus
.Related PRs #7029 & #6871
The text was updated successfully, but these errors were encountered: