mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
fix(onClick-trigger-target): trigger is null
trigger is null if call an async function between "click the button" and " new Clipboard()"
This commit is contained in:
parent
57345ab3ce
commit
7593c07a4b
@ -68,7 +68,7 @@ class Clipboard extends Emitter {
|
||||
* @param {Event} e
|
||||
*/
|
||||
onClick(e) {
|
||||
const trigger = e.delegateTarget || e.currentTarget;
|
||||
const trigger = e.delegateTarget || e.currentTarget || e.target;
|
||||
const selectedText = ClipboardActionDefault({
|
||||
action: this.action(trigger),
|
||||
container: this.container,
|
||||
|
Loading…
Reference in New Issue
Block a user