Skip to content

Commit

Permalink
fixed fallback text selection on Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
owen-m1 authored and elo7-developer committed Nov 18, 2019
1 parent 3dce3a7 commit 40658b4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,9 @@ define('sortable', [], function sortableFactory() {

_this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback));
_on(document, 'selectstart', _this);
if (Safari) {
_css(document.body, 'user-select', 'none');
}
},

// Returns true - if no further action is needed (either inserted or another condition)
Expand Down Expand Up @@ -1402,6 +1405,10 @@ define('sortable', [], function sortableFactory() {
_off(document, 'dragover', _checkAlignment);
}

if (Safari) {
_css(document.body, 'user-select', '');
}

this._offUpEvents();

if (evt) {
Expand Down

0 comments on commit 40658b4

Please sign in to comment.