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

Inserter: Inner blocks not inserted at correct location #24403

Closed
sirreal opened this issue Aug 6, 2020 · 12 comments · Fixed by #26443
Closed

Inserter: Inner blocks not inserted at correct location #24403

sirreal opened this issue Aug 6, 2020 · 12 comments · Fixed by #26443
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P [Priority] High Used to indicate top priority items that need quick attention [Type] Regression Related to a regression in the latest release

Comments

@sirreal
Copy link
Member

sirreal commented Aug 6, 2020

Blocks may not be inserted in the correct location when using the following steps:

  • Use a layout type block that uses inner blocks and appenders, e.g. Columns block.
  • The active or selected block should be in a different location.
  • Access the quick inserter (click the + block appender in an inner block).
  • Click "Browse all" button at the bottom of the quick inserter.
  • The main inserter is opened, click a block to insert it.
  • The block is inserted at the top level, not where the + appender was clicked.

Visual flow

Setup

Screen Shot 2020-08-06 at 12 28 39

Click appender to access quick inserter

Screen Shot 2020-08-06 at 12 29 03

Click "Browse all" to access the main inserter

Screen Shot 2020-08-06 at 12 29 13

Pick a block from the main inserter

Screen Shot 2020-08-06 at 12 29 34

The block is not inserted where the appender was clicked

Screen Shot 2020-08-06 at 12 29 56

Context

I believe this is the same issue as described in #24262. #24285 closed that issue, but it appears to have addressed an insertion bug in top level blocks, not in inner blocks.


Editor version:

  • WordPress version: 5.4
  • Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default? Gutenberg plugin
  • If the Gutenberg plugin is installed, which version is it? 8.7

Related: #24402

@sirreal sirreal 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 labels Aug 6, 2020
@talldan talldan added [Priority] High Used to indicate top priority items that need quick attention [Type] Regression Related to a regression in the latest release and removed [Type] Bug An existing feature does not function as intended labels Aug 18, 2020
@talldan
Copy link
Contributor

talldan commented Aug 18, 2020

Also reported in #24501. This seems like something important to fix for WordPress 5.5.1.

@chvillanuevap
Copy link

Is there a filter to show more than 6 blocks (like in block variations, which show all variations available)? This could be a quick fix for now.

@torounit
Copy link
Member

torounit commented Sep 1, 2020

The destinationRootClientId in useInsertionPoint is undefined .

Is this related?

@chvillanuevap
Copy link

Is this making it to 5.5.1?

@chvillanuevap
Copy link

Any updates on this? I have a set of custom blocks for an email template builder I developed. I have an inner block (email content) with templateLock set to true. Inside this inner block I have other inner blocks where the user can insert blocks (email preheader, header, body, footer). When the user clicks on the appender button, the Browser Directory shows nothing because of the template lock of the outermost inner block. It's super confusing, and I have gotten a lot of complaints from my clients.
Screen Shot 2020-09-17 at 7 23 26 PM

@barryceelen
Copy link
Contributor

barryceelen commented Sep 29, 2020

Seeing the same issue that @chvillanuevap mentions above, but wanted to mention that I'm seeing this behaviour:

  1. Use inserter on empty InnerBlocks element: clicking "Browse All" results in empty main inserter
  2. Use inserter if there is already a block present in the InnerBlocks element: clicking "Browse all" results in a correctly populated main inserter, and selecting a block inserts it in its correct position in the InnerBlocks element.

It seems adding a min-height to the InnerBlocks element makes this work consistently (broken) for me.

@chvillanuevap
Copy link

I just wanted to add that this behavior not only applies to blocks, but also block patterns.

@talldan
Copy link
Contributor

talldan commented Oct 20, 2020

#26281 reported the same issue for patterns.

@PHuhn
Copy link

PHuhn commented Nov 1, 2020

Hey:

I wrote the following on the forum on WordPress.org.

The Gutenberg editor looses location of add (+) clicked in the content area, if ‘Browse all’ clicked.

I use Group block a lot. It seem to happen a lot when I click within the Group block. The problem is not limited to Group block.

Example:
Add new page…
Add Group block
Clicked the + within the Group block.
I clicked ‘Browse All’ on the block selection, => clicked Columns block and it placed the Columns block as the last element.

Thanks for a great editor. Phil

@noisysocks noisysocks removed their assignment Nov 1, 2020
@noisysocks noisysocks removed the [Status] In Progress Tracking issues with work in progress label Nov 1, 2020
@noisysocks
Copy link
Member

I've had to step away from this. Feel free to pick up #26443 and finish it or to use it as inspiration for a different approach.

@gziolo gziolo added the [Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P label Nov 8, 2020
@eliawk
Copy link

eliawk commented Jul 25, 2021

Same error con WP 5.7.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P [Priority] High Used to indicate top priority items that need quick attention [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants