mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
Do not clear text on mobile devices - fix #26
This commit is contained in:
6
dist/clipboard.js
vendored
6
dist/clipboard.js
vendored
@@ -371,6 +371,12 @@ var ClipboardAction = (function () {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
ClipboardAction.prototype.clearSelection = function clearSelection() {
|
ClipboardAction.prototype.clearSelection = function clearSelection() {
|
||||||
|
var force = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0];
|
||||||
|
|
||||||
|
if (!force && navigator.userAgent.indexOf('Mobile') > -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.target) {
|
if (this.target) {
|
||||||
this.target.blur();
|
this.target.blur();
|
||||||
}
|
}
|
||||||
|
|||||||
2
dist/clipboard.min.js
vendored
2
dist/clipboard.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -143,7 +143,11 @@ class ClipboardAction {
|
|||||||
/**
|
/**
|
||||||
* Removes current selection and focus from `target` element.
|
* Removes current selection and focus from `target` element.
|
||||||
*/
|
*/
|
||||||
clearSelection() {
|
clearSelection(force = false) {
|
||||||
|
if (!force && navigator.userAgent.indexOf('Mobile') > -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.target) {
|
if (this.target) {
|
||||||
this.target.blur();
|
this.target.blur();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user