Skip to content

Commit

Permalink
simpler version
Browse files Browse the repository at this point in the history
Signed-off-by: Olivier Tassinari <olivier.tassinari@gmail.com>
  • Loading branch information
oliviertassinari committed Jan 2, 2023
1 parent 06f49cf commit 6e28144
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function writeToClipboardPolyfill(data: string) {

function hasNativeSelection(element: HTMLInputElement) {
// When getSelection is called on an <iframe> that is not displayed Firefox will return null.
if (window.getSelection() && window.getSelection()!.toString() !== '') {
if (window.getSelection()?.toString()) {
return true;
}

Expand Down

0 comments on commit 6e28144

Please sign in to comment.