gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Navigating quickly down blocks can cause toolbars to flicker indefinitely

Open ephox-mogran opened this issue 9 years ago • 4 comments

Issue Overview

Note, this is an extremely intermittent bug

When navigating quickly between blocks, gutenberg can sometimes get into a state where it keeps switching focus in a cycle between a few blocks.

Steps to Reproduce (for bugs)

  1. Create a new page with about ten paragraph blocks (you may need more) and fill in dummy content
  2. Hold down the down key from the first block until you get to the end
  3. If nothing chaotic happens, hold up to get back to the start, and if still nothing chaotic happens, hold down to go back to the end.

Browser: Chrome

Expected Behavior

Navigation continues normally up and down the page

Current Behavior

The navigation gets into a cycle where the focus gets trapped between a few blocks and rapidly switches between them. The toolbar, consequently, flickers up and down the page. The only way to stop it to transfer the focus. Clicking on Elements in the Chrome inspector seems to work well.

Possible Solution

This is an interaction between focus logic in TinyMCE, and how Gutenberg is focusing editors in WritingFlow keydown. We can replicate a similar problem outside of gutenberg (see Fiddle here). The solution will be handled within TinyMCE.

Related Issues and/or PRs

Todos

  • [ ] Tests
  • [ ] Documentation

ephox-mogran avatar Oct 16 '17 06:10 ephox-mogran

I ran into something similar... Is this the problem?

https://www.dropbox.com/s/c0ek76t2mbi8eta/untitled.mp4?dl=0

ellatrix avatar Oct 17 '17 17:10 ellatrix

Yep, that's the problem. It's an issue in tinymce that is surfaced by quickly opening new inline sections without removing previous ones (I think). It's not your other navigation code, as I can replicate it in that fiddle.

ephox-mogran avatar Oct 17 '17 19:10 ephox-mogran

This should be fixed in TinyMCE 7.4.2

ephox-mogran avatar Oct 23 '17 04:10 ephox-mogran

This has been fixed as of TinyMCE 4.7.2.

ephox-mogran avatar Nov 08 '17 04:11 ephox-mogran