We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa56ec5 commit 3aaeb48Copy full SHA for 3aaeb48
src/components/table/helpers/text-selection-active.js
@@ -4,12 +4,13 @@
4
// Accepts an element as only argument to test to see if selection overlaps or is
5
// contained within the element
6
7
-import { isELement } from '../../../utils/dom'
+import { isElement } from '../../../utils/dom'
8
9
export default function textSelectionActive(el = document) {
10
const win = window
11
/* 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
15
} else {
16
return false
0 commit comments