Skip to content

Commit

Permalink
Minor tweak (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
Richienb authored Oct 9, 2021
1 parent 73c0839 commit 5adbfb3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ export default function copyTextToClipboard(input, {target = document.body} = {}
element.style.fontSize = '12pt'; // Prevent zooming on iOS

const selection = document.getSelection();
let originalRange = false;
if (selection.rangeCount > 0) {
originalRange = selection.getRangeAt(0);
}
const originalRange = selection.rangeCount > 0 && selection.getRangeAt(0);

target.append(element);
element.select();
Expand Down

0 comments on commit 5adbfb3

Please sign in to comment.