chore: refactor PR #716 (#717)

This commit is contained in:
Nolan Lawson 2018-12-02 23:19:15 -08:00 committed by GitHub
parent e894e031fb
commit da7a29d503
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -17,7 +17,7 @@ function onEvent (e) {
if (type === 'click') { if (type === 'click') {
let selection = window.getSelection() let selection = window.getSelection()
let selectionStr = selection && selection.toString() let selectionStr = selection && selection.toString()
if (selectionStr && selection.toString().length && target.contains(selection.anchorNode)) { if (selectionStr && selectionStr.length && target.contains(selection.anchorNode)) {
return // ignore if the user is selecting text inside the clickable area return // ignore if the user is selecting text inside the clickable area
} }
} }