File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
- import { NodeType } from '../utils' ;
1
+ import { NodeType , closest } from '../utils' ;
2
2
3
3
export default function defaultShouldCancelStart ( event ) {
4
4
// Cancel sorting if the event target is an `input`, `textarea`, `select` or `option`
5
- const disabledElements = [
5
+ const interactiveElements = [
6
6
NodeType . Input ,
7
7
NodeType . Textarea ,
8
8
NodeType . Select ,
9
9
NodeType . Option ,
10
10
NodeType . Button ,
11
11
] ;
12
12
13
- if ( disabledElements . indexOf ( event . target . tagName ) !== - 1 ) {
13
+ if ( interactiveElements . indexOf ( event . target . tagName ) !== - 1 ) {
14
14
// Return true to cancel sorting
15
15
return true ;
16
16
}
17
17
18
+ if ( closest ( event . target , ( el ) => el . contentEditable === 'true' ) ) {
19
+ return true ;
20
+ }
21
+
18
22
return false ;
19
23
}
You can’t perform that action at this time.
0 commit comments