Fix backspacing into a block from offset 0 in Firefox #338

Merged
merged 2 commits into from Nov 15, 2016

Projects

None yet

1 participant

@javan
Member
javan commented Nov 13, 2016

In Firefox, pressing backspace when the cursor is positioned after a comment node will only remove that node, which effectively deletes nothing.

Minimal test case: Open data:text/html;charset=utf-8,%3Cdiv contenteditable%3Ea%3C!--z--%3E%3C!--z--%3E%3C!--z--%3Eb%3C/div%3E in Firefox and press backspace from the end.

Possibly related bug: https://bugzilla.mozilla.org/show_bug.cgi?id=685445

Trix, as of 759e62d, detects the mutation / input mismatch and reparses the document resulting in no deletion and the cursor jumping to the end of the block.

Before:
backspace-before

After:
backspace-after

@javan javan merged commit bb118e6 into master Nov 15, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@javan javan deleted the fix-firefox-backspace-into-block branch Nov 15, 2016
@javan javan added a commit that referenced this pull request Jan 22, 2017
@javan javan Own rendering when deleting selection that spans blocks. Fixes #360
Avoids a contenteditable bug in Firefox that could result in duplicated <trix-editor>s. Tracked down and reported here: https://bugzilla.mozilla.org/show_bug.cgi?id=1332924.

Somewhat related: #338
44b4023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment