-
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
Orphan buttons after focus on an Image or a Gallery #9184
Comments
Tested and confirmed that clicking on an image block or clicking on another kind of block after clicking on an image results in the following empty button HTML appearing just above the
Note: clicking between paragraphs or other types of blocks doesn’t seem to trigger the empty buttons. |
This is a complex problem I was able to reproduce it in my tests. |
I can reproduce with Gallery today but not the image block |
I can still reproduce this. |
I found another way to reproduce this, switching between the document and block tabs in the sidebar. Debugged it by breaking on subtree modifications of the body element. It's caused by the MediaUpload component. The featured image uploader is the cause of it in the sidebar. Every time that's constructed it initialises wp.media:
It looks like it's this bit of code that appends the button when that initialisation happens: Not quite sure why it does that, but I'll keep digging to see if I can find out 😄 |
I've opened a trac issue for this as well: It might be that the issue can be solved in wp core alone, but until we can verify where the fix should take place I think it's best to leave both issues open. |
I'm inclined to say that the block editor should do what the classic editor does and not reinitialise the media frame when it already exists. See this comment for more info. |
Chiming in here to say that I'm able to reproduce this with just the |
Just confirmed that this still happens in WP5.8 and Gutenberg 11.4.1 |
I couldn't replicate this on WP 5.9 and GB 13.1: image-buttons.mp4Seems to have been resolved somehow, can't see any obvious fix anywhere, but going to close for now. Feel free to reopen if you can still replicate. |
Describe the bug
Whenever you focus an Image Block or Gallery Block, a
button
element is created just before the closingbody
tag. Then, after blurring, thebutton
is still there. This can be performed indefinitely times, leading to a massive amount of orphanbutton
elementsTo Reproduce
Steps to reproduce the behavior:
Elements
tab in your Dev Tools, right before the closingbody
tagExpected behavior
There shouldn't be any left over
button
elementsScreenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: