Skip to content
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

The in-between inserter doesn't appear when the last child block is selected #53315

Closed
hanneslsm opened this issue Aug 3, 2023 · 4 comments · Fixed by #64229
Closed

The in-between inserter doesn't appear when the last child block is selected #53315

hanneslsm opened this issue Aug 3, 2023 · 4 comments · Fixed by #64229
Assignees
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images Needs Dev Ready for, and needs developer efforts [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@hanneslsm
Copy link

Description

Coming from #47200 (comment)

The inserter does appear in Galleries, even when an image is selected. However, it does not appear when the last image is selected.

Step-by-step reproduction instructions

  1. Create a galley
  2. Insert images
  3. Select the last image
  4. The inserter does not show up on the left and top of the images

Screenshots, screen recording, code snippet

Screen.Recording.2023-08-03.at.23.14.26.mp4

Environment info

  • WP 6.3-RC3-56344
  • GB 16.3

Please confirm that you have searched existing issues in the repo.

No

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@hanneslsm hanneslsm changed the title Gallery: Inserter does not appear when the most right and last image is selected Gallery: Inserter does not appear when the most right or last image is selected Aug 3, 2023
@jordesign jordesign added [Type] Enhancement A suggestion for improvement. [Block] Gallery Affects the Gallery Block - used to display groups of images labels Aug 4, 2023
@annezazu annezazu added this to Polish Aug 4, 2023
@annezazu annezazu moved this to Needs development in Polish Aug 4, 2023
@annezazu annezazu added the Needs Dev Ready for, and needs developer efforts label Aug 4, 2023
@annezazu
Copy link
Contributor

annezazu commented Aug 4, 2023

Thanks for opening this! Looks like a straight forward dev task to dive into. Added to the Polish board :)

@hanneslsm
Copy link
Author

We must consider what happens if there is only one image in the gallery. Probably nothing, but if we find a solution it could fix #50021

@Mamaduka Mamaduka changed the title Gallery: Inserter does not appear when the most right or last image is selected The in-between inserter doesn't appear when the last child block is selected. Feb 13, 2024
@Mamaduka Mamaduka changed the title The in-between inserter doesn't appear when the last child block is selected. The in-between inserter doesn't appear when the last child block is selected Feb 13, 2024
@Mamaduka
Copy link
Member

I believe this issue isn't limited to the Gallery block; I can reproduce the same bug with Buttons and Columns.

As far as I can tell, useInBetweenInserter returns early due to this condition:

// Don't show the inserter when hovering above (conflicts with
// block toolbar) or inside selected block(s).
if ( getSelectedBlockClientIds().includes( clientId ) ) {
return;
}

cc @ellatrix, @talldan

Steps to reproduce

  1. Open a post or page.
  2. Insert Buttons or Column blocks with at least three inner blocks.
  3. Select the last block.
  4. Try enabling in-between inserter. See the screencast.

Screencast

CleanShot.2024-02-13.at.17.37.44.mp4

@talldan
Copy link
Contributor

talldan commented Feb 14, 2024

I believe this issue isn't limited to the Gallery block; I can reproduce the same bug with Buttons and Columns.

As far as I can tell, useInBetweenInserter returns early due to this condition:

Good find, that stops the in-between inserter from showing under the toolbar in vertical block lists, but it wouldn't be an issue for horizontal block lists. There could be some kind of additional logic added to that if statement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images Needs Dev Ready for, and needs developer efforts [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

6 participants