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' ;
22
33export default function defaultShouldCancelStart ( event ) {
44 // Cancel sorting if the event target is an `input`, `textarea`, `select` or `option`
5- const disabledElements = [
5+ const interactiveElements = [
66 NodeType . Input ,
77 NodeType . Textarea ,
88 NodeType . Select ,
99 NodeType . Option ,
1010 NodeType . Button ,
1111 ] ;
1212
13- if ( disabledElements . indexOf ( event . target . tagName ) !== - 1 ) {
13+ if ( interactiveElements . indexOf ( event . target . tagName ) !== - 1 ) {
1414 // Return true to cancel sorting
1515 return true ;
1616 }
1717
18+ if ( closest ( event . target , ( el ) => el . contentEditable === 'true' ) ) {
19+ return true ;
20+ }
21+
1822 return false ;
1923}
You can’t perform that action at this time.
0 commit comments