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

Commit

Permalink
Fixes #488; allow new line at the end of the line in Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
danburzo committed Jul 22, 2016
1 parent 28cf9bc commit 32c04aa
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 32c04aa

Please sign in to comment.