Fix #805 don't blur() the trigger after a clipboard action (#807)

* Remove the `blur()` following a clipboard action

It's pointless to set `focus()` on the trigger first, if in the next step you're just going to `blur()` the active element anyway.

* Tweak test to not expect active element to be body

Since it's now not `blur()`ing anymore

* Fix test

see https://github.com/zenorocha/clipboard.js/pull/807#discussion_r862080076
This commit is contained in:
Patrick H. Lauke
2022-05-04 18:45:44 +01:00
committed by GitHub
parent c7c7fda422
commit 08169bce8c
2 changed files with 4 additions and 5 deletions

View File

@@ -86,7 +86,6 @@ class Clipboard extends Emitter {
if (trigger) {
trigger.focus();
}
document.activeElement.blur();
window.getSelection().removeAllRanges();
},
});