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

In-between inserter: Unexpected vertical inserter display #64227

Closed
2 tasks done
t-hamano opened this issue Aug 4, 2024 · 0 comments · Fixed by #64241
Closed
2 tasks done

In-between inserter: Unexpected vertical inserter display #64227

t-hamano opened this issue Aug 4, 2024 · 0 comments · Fixed by #64241
Assignees
Labels
[Feature] Drag and Drop Drag and drop functionality when working with blocks [Feature] Inserter The main way to insert blocks using the + button in the editing interface [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@t-hamano
Copy link
Contributor

t-hamano commented Aug 4, 2024

Description

In #56186, a vertical inserter was introduced to create Rows and Galleries. However, this causes unintended behavior in some scenarios.

For example, we should consider the following scenarios:

  • Group block is not registered
  • Row variation is not registered
  • Gallery block is not registered
  • Cannot be wrapped in a Row block

Step-by-step reproduction instructions

From what I have seen, the scenarios that cause the problem are:

Create galleries from Image blocks

If both the Gallery block and the Row variation are not enabled:

  • Expected: The inserter should not be displayed
  • Actual: ❌ The inserter is displayed and you will get a browser console error like this once the drop is complete:
Uncaught Error: Block type 'core/gallery' is not registered.`
bafbe834b30aa1f641af2cfbac8fd31a.mp4

Create Rows from selected blocks

If the Row variation is not enabled:

  • Expected: The inserter should not be displayed
  • Actual: ❌ The inserter is displayed and the Row block with layout.type as flex appears to be created correctly, but the block name remains Group.
e9c94d89c8f0d666951faa9ca5ec765b.mp4

When a Row block cannot be created

For example, if the button orientation is vertical:

  • Expected: Since we cannot create a Row block from the Button block (not the Buttons block), the inserter itself should not be displayed.
  • Actual: ❌ The inserter appears. Buttons get duplicated and/or the browser freezes.
7429af61470d499fda765f06e29c186b.mp4

Screenshots, screen recording, code snippet

No response

Environment info

No response

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

  • Yes

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

  • Yes
@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Feature] Inserter The main way to insert blocks using the + button in the editing interface [Feature] Drag and Drop Drag and drop functionality when working with blocks labels Aug 4, 2024
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Drag and Drop Drag and drop functionality when working with blocks [Feature] Inserter The main way to insert blocks using the + button in the editing interface [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant