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

Quick inserter: hard to initiate quick inserter after a few times using it #65106

Closed
annezazu opened this issue Sep 6, 2024 · 4 comments
Closed
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Type] Bug An existing feature does not function as intended

Comments

@annezazu
Copy link
Contributor

annezazu commented Sep 6, 2024

Using WordPress 6.6.2 and Gutenberg 19.1 in a playground instance, I noticed that, after a first few times, the quick inserter suddenly becomes very hard to initiate. I can't quite understand why but here's a longer video showing how suddenly the same areas where I could use the quick inserter no longer cause it to appear:

quick.inserter.not.appearing.mp4

I can reliably replicate it using TT4 and just clicking around and trying to get it to appear.

@annezazu annezazu 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 Sep 6, 2024
@Mamaduka
Copy link
Member

Mamaduka commented Sep 6, 2024

Thanks, @annezazu! This is an interesting issue.

Did you also notice any performance degradation? We have some reports related to Inserter + Pattern performance, and I wonder if they are related. See: #64732.

A possible fix will ship with Gutenberg 19.2 - #64902.

@annezazu
Copy link
Contributor Author

annezazu commented Sep 9, 2024

I didn’t notice anything with performance when I was clicking around! It could be that that’s the underlying cause though but it wasn’t discernible to me.

@Mamaduka
Copy link
Member

Mamaduka commented Sep 10, 2024

I can also reproduce the issue on the Gutenberg trunk, but I'm having trouble finding a consistent way to do it.

I tracked down the bug to the useInBetweenInserter hook. The openRef.current is set to true permanently, which prevents any other in-between inserters from displaying. Unfortunately, I'm still not sure what is causing this behavior.

// openRef is the reference to the insertion point between blocks.
// If the reference is not set or the insertion point is already open, return.
if ( openRef === undefined || openRef.current ) {
return;
}

Update: I think I found a consistent way to reproduce the bug. It looks like the onSelectOrClose is never called when moving focus to a different block on canvas.

  1. Create a page.
  2. Add a couple of paragraphs.
  3. Open in-between inserter.
  4. Move the focus to a different block without closing the inserter.
  5. Notice that the inserter no longer appears when hovering between the blocks.

Screencast

CleanShot.2024-09-10.at.13.29.30.mp4

@Mamaduka
Copy link
Member

This is fixed on the trunk. See: #65208.

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 [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants