Don't copy when user has selected text manually
This commit is contained in:
parent
015db23a7b
commit
c41ea7e08d
@ -85,6 +85,11 @@ MaterialComponentsSnippets.prototype.onMouseClickHandler = function(snippet) {
|
||||
'use strict';
|
||||
|
||||
return function() {
|
||||
if (window.getSelection().toString().length > 0) {
|
||||
// user has selected some text manually
|
||||
// don't do anything
|
||||
return;
|
||||
}
|
||||
if (this.copyToClipboard(snippet)) {
|
||||
snippet.classList.add(this.CssClasses_.COPIED);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user