mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
Fixes discontiguous selection #17
This commit is contained in:
parent
5e43e84d91
commit
9377659c9c
3
dist/clipboard.js
vendored
3
dist/clipboard.js
vendored
@ -294,7 +294,7 @@ var ClipboardAction = (function () {
|
||||
|
||||
/**
|
||||
* Only removes the fake element after another click event, that way
|
||||
* an user can hit `Ctrl+C` to copy because selection still exists.
|
||||
* a user can hit `Ctrl+C` to copy because selection still exists.
|
||||
*/
|
||||
|
||||
ClipboardAction.prototype.removeFake = function removeFake() {
|
||||
@ -321,6 +321,7 @@ var ClipboardAction = (function () {
|
||||
var range = document.createRange();
|
||||
var selection = window.getSelection();
|
||||
|
||||
selection.removeAllRanges();
|
||||
range.selectNodeContents(this.target);
|
||||
selection.addRange(range);
|
||||
this.selectedText = selection.toString();
|
||||
|
2
dist/clipboard.min.js
vendored
2
dist/clipboard.min.js
vendored
File diff suppressed because one or more lines are too long
@ -95,6 +95,7 @@ class ClipboardAction {
|
||||
let range = document.createRange();
|
||||
let selection = window.getSelection();
|
||||
|
||||
selection.removeAllRanges();
|
||||
range.selectNodeContents(this.target);
|
||||
selection.addRange(range);
|
||||
this.selectedText = selection.toString();
|
||||
|
Loading…
Reference in New Issue
Block a user