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:
parent
a4c8bc5bf0
commit
82bf1b93a4
6
dist/clipboard.js
vendored
6
dist/clipboard.js
vendored
@ -371,6 +371,12 @@ var ClipboardAction = (function () {
|
||||
*/
|
||||
|
||||
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) {
|
||||
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.
|
||||
*/
|
||||
clearSelection() {
|
||||
clearSelection(force = false) {
|
||||
if (!force && navigator.userAgent.indexOf('Mobile') > -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.target) {
|
||||
this.target.blur();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user