Skip to content

Commit d0e3436

Browse files
authored
Update text-selection-active.js
1 parent c26670d commit d0e3436

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/components/table/helpers/text-selection-active.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
// Helper to determine if a there is an active text selection on the document page.
22
// Used to filter out click events caused by the mouse up at end of selection
3-
//
4-
// Expects an element reference to check to see if the selection contains part
5-
// of or is contained within the element.
63

7-
import { isElement } from '../../../utils/dom'
8-
9-
export default function textSelectionActive(el) {
4+
export default function textSelectionActive() {
105
const win = window
116
/* istanbul ignore if: JSDOM doesn't support getSelection */
12-
if (win && win.getSelection && win.getSelection().toString() !== '' && isElement(el)) {
13-
const sel = win.getSelection()
14-
return sel.containsNode ? sel.containsNode(el, true) : false
7+
if (win && win.getSelection && win.getSelection().toString() !== '') {
8+
return true
159
} else {
1610
return false
1711
}

0 commit comments

Comments
 (0)