Skip to content

Commit

Permalink
Remove quill selection polyfill caching
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan committed Oct 16, 2018
1 parent 3c9b972 commit 5331cb2
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions core/shadow-selection-polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,24 +222,14 @@ function ignoredTrailingSpace(node) {
return trailingSpaceCount - 1; // always allow single last
}

const cachedRange = new Map();
export function getRange(root) {
if (hasSelection || useDocument) {
const s = (useDocument ? document : root).getSelection();
return s.rangeCount ? s.getRangeAt(0) : null;
}

const thisFrame = cachedRange.get(root);
if (thisFrame) {
return thisFrame;
}

const result = internalGetShadowSelection(root);

cachedRange.set(root, result.range);
window.setTimeout(() => {
cachedRange.delete(root);
}, 0);
return result.range;
}

Expand Down

0 comments on commit 5331cb2

Please sign in to comment.