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

Fix selecting attachments in MS Edge #531

Merged
merged 3 commits into from Sep 12, 2018

Conversation

Projects
None yet
1 participant
@javan
Member

javan commented Sep 11, 2018

Currently, Trix programmatically selects attachments using a DOM Range anchored to the text nodes in the surrounding cursor target elements.

<span>⋮</span><figure>…</figure><span>⋮</span>

represents a zero width space character.

That range has worked reliably in all browsers including Microsoft Edge… until recently. Edge 17 regressed from 16 and incorrectly applies it around the left cursor target’s text node. Turns out this issue exists in earlier versions of Edge too. This issue may have exacerbated the problem in Trix starting with Edge 17. 🤷‍♂️

<span>⋮ </span><figure>…</figure><span></span>

This change works around the problem by anchoring to the cursor target elements instead of their text nodes.

<span>⋮</span><figure >…</figure><span>⋮</span>

The resulting selection is visually and functionally equivalent.

Special case DOM ranges for cursor targets
Fixes selecting attachments in MS Edge 17

@javan javan added the WIP label Sep 11, 2018

@javan javan removed the WIP label Sep 12, 2018

@javan javan merged commit d673de4 into master Sep 12, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@javan javan deleted the msedge-17-attachment-selection-fix branch Sep 12, 2018

@javan javan changed the title from Fix selecting attachments in MS Edge 17 to Fix selecting attachments in MS Edge Sep 13, 2018

@javan

This comment has been minimized.

Show comment
Hide comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment