Skip to content
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.

Commit

Permalink
Merge pull request #492 from danburzo/gh488
Browse files Browse the repository at this point in the history
Fixes #488; allow new line at the end of the line in Safari
  • Loading branch information
katebee authored Feb 3, 2017
2 parents fcf4e16 + 32c04aa commit a0a386c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/plugins/core/inline-elements-mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ define(['../../node'], function (nodeHelpers) {
var brNode = document.createElement('br');

range.insertNode(brNode);

// Safari does not update the endoffset after inserting the BR element
// so we have to do it ourselves.
// References:
// https://bugs.webkit.org/show_bug.cgi?id=63538#c3
// https://dom.spec.whatwg.org/#dom-range-selectnode
range.setEndAfter(brNode);

// After inserting the BR into the range is no longer collapsed, so
// we have to collapse it again.
// TODO: Older versions of Firefox require this argument even though
Expand Down

0 comments on commit a0a386c

Please sign in to comment.