-
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
Gallery edit button appears on all blocks once a gallery block is added #1307
Comments
Yeah, turns out this happens when there is a gallery block somewhere else in the content. It doesn't need to directly follow the embed block. As soon as I remove the gallery, the edit button for the embed is gone. When I re-add it, it's back again. |
Reproduced. This goes a bit further too, seems that the edit button on the gallery block gets applied to every subsequent block in the post. Thanks for finding this! |
Worth noting that it does not only affect blocks after the gallery block. In my dummy post, the embed block comes first. |
You're absolutely right, sorry, missed its appearance when I tested! |
First look at this... (and I'm most likely wrong, first time looking at this code...) In
And then in
So that appears to me that we're adding the edit button to Formatting.Toolbar. and that's gettnig rendered on all blocks that use the formatting toolbar. Calling @aduth, @iseulde, and @youknowriad 😄 |
The problem is that a block's focus && (
<Fill name="Formatting.Toolbar">
<Toolbar controls={ [ {
icon: 'edit',
title: __( 'Edit Gallery' ),
onClick: () => editMediaLibrary( attributes, setAttributes ),
} ] } />
</Fill>
) ...it should work correctly again. Documentation: https://github.com/WordPress/gutenberg/tree/master/blocks#blockcontrols |
Ah, that's making sense, ok great I think I can pick this up :) |
Fixed in #1262 |
Tested using the current plugin in the WordPress Plugin Directory (0.10.0).
Steps to reproduce:
Expected:
The form to edit the embed URL is shown, or perhaps even a bunch of new options (e.g. timeframe for YouTube videos or color options for tweets).
Actual result:
The media modal gets opened, with the "Edit Gallery" view being shown. Obviously, I'm not editing a gallery.
The text was updated successfully, but these errors were encountered: