gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Arrow navigation broken in Firefox

Open ellatrix opened this issue 9 years ago • 6 comments

To reproduce, create e.g. two paragraphs in Firefox and try to use the arrow keys to move the caret from one to another. Normally this should work. In Firefox it does not. The selection API probably behaves a bit different there, though I'm pretty sure it used to work.

ellatrix avatar Aug 01 '17 16:08 ellatrix

Related: #2222. Also related: pressing arrow twice in empty editable. Looking for an alternative solution that may give a better experience too.

ellatrix avatar Aug 08 '17 19:08 ellatrix

@iseulde are you also looking at #2222? I plan to look at this next if not. Also @EphoxJames is working on #2392 will this issue overlap with that?

tg-ephox avatar Aug 17 '17 00:08 tg-ephox

@iseulde part of the problem with this issue is around links. When you left or right arrow through the TinyMCE editor, as it gets to a link the cursor position stays the same when it changes the style to display the link. That causes this code to assume the beginning or end of the block has been reached: https://github.com/WordPress/gutenberg/blob/595efd81005645e5622c5e0628a221081f6cbaf0/editor/modes/visual-editor/block.js#L294

A different approach to handling this would be required though. Maybe a custom event or a callback prop on the block to say when the end of editor has been reached?

tg-ephox avatar Aug 17 '17 07:08 tg-ephox

@tg-ephox Yeah I know. There's PRs such as #2431.

ellatrix avatar Aug 17 '17 10:08 ellatrix

I should have linked to the issues.

ellatrix avatar Aug 17 '17 11:08 ellatrix

should be fixed by #2424

youknowriad avatar Aug 29 '17 17:08 youknowriad