Skip to content

Commit

Permalink
Merge pull request #27 from jaybekster/edge-scroll-fix
Browse files Browse the repository at this point in the history
Fix MS Edge when it scrolls to last added and selected HTMLElement
  • Loading branch information
sudodoki committed May 31, 2016
2 parents 780e165 + fec9e17 commit 507ac4d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ function copy(text, options) {
mark.textContent = text;
// used to conserve newline, etc
mark.style.whiteSpace = 'pre';

// prevents scrolling to the end of the page
mark.style.position = 'fixed';
mark.style.height = 0;
mark.style.width = 0;
mark.style.overflow = 'hidden';

document.body.appendChild(mark);

range.selectNode(mark);
Expand Down

0 comments on commit 507ac4d

Please sign in to comment.