Skip to content

Commit

Permalink
removing element after selection
Browse files Browse the repository at this point in the history
  • Loading branch information
vitormalencar committed Feb 24, 2021
1 parent 982d5ef commit dc2b5bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/clipboard-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ class ClipboardAction {
selectFake() {
const isRTL = document.documentElement.getAttribute('dir') == 'rtl';

this.removeFake();

this.fakeHandlerCallback = () => this.removeFake();
this.fakeHandler =
this.container.addEventListener('click', this.fakeHandlerCallback) ||
Expand All @@ -75,6 +73,8 @@ class ClipboardAction {

this.selectedText = select(this.fakeElem);
this.copyText();

this.removeFake();
}

/**
Expand Down

0 comments on commit dc2b5bf

Please sign in to comment.