File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
src/components/table/helpers Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 1
1
// Helper to determine if a there is an active text selection on the document page.
2
2
// 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.
6
3
7
- import { isElement } from '../../../utils/dom'
8
-
9
- export default function textSelectionActive ( el ) {
4
+ export default function textSelectionActive ( ) {
10
5
const win = window
11
6
/* 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
15
9
} else {
16
10
return false
17
11
}
You can’t perform that action at this time.
0 commit comments