File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,9 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt
134134 const name = ( e . target as HTMLElement ) . nodeName . toLowerCase ( ) ;
135135 if ( skipMouseDown . find ( skip => skip === name ) ) return true ;
136136
137+ //for contenteditable
138+ if ( ( e . target as HTMLElement ) . closest ( '[contenteditable="true"]' ) ) return true ;
139+
137140 // make sure we are clicking on a drag handle or child of it...
138141 // Note: we don't need to check that's handle is an immediate child, as mouseHandled will prevent parents from also handling it (lowest wins)
139142 //
@@ -153,8 +156,13 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt
153156 this . dragEl . addEventListener ( 'touchmove' , touchmove ) ;
154157 this . dragEl . addEventListener ( 'touchend' , touchend ) ;
155158 }
156-
159+
157160 e . preventDefault ( ) ;
161+
162+ //e.preventDefault() prevents blur event which occurs just after mousedown event.
163+ //if an editable content has focus, then blur must be call
164+ if ( document . activeElement ) ( document . activeElement as HTMLElement ) . blur ( ) ;
165+
158166 DDManager . mouseHandled = true ;
159167 return true ;
160168 }
You can’t perform that action at this time.
0 commit comments