File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
editor/components/block-list Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ export class BlockListBlock extends Component {
104104 this . stopTypingOnMouseMove = this . stopTypingOnMouseMove . bind ( this ) ;
105105 this . mergeBlocks = this . mergeBlocks . bind ( this ) ;
106106 this . onFocus = this . onFocus . bind ( this ) ;
107+ this . preventDrag = this . preventDrag . bind ( this ) ;
107108 this . onPointerDown = this . onPointerDown . bind ( this ) ;
108109 this . onKeyDown = this . onKeyDown . bind ( this ) ;
109110 this . onBlockError = this . onBlockError . bind ( this ) ;
@@ -280,6 +281,18 @@ export class BlockListBlock extends Component {
280281 }
281282 }
282283
284+ /**
285+ * Prevents default dragging behavior within a block to allow for multi-
286+ * selection to take effect unhampered.
287+ *
288+ * @param {DragEvent } event Drag event.
289+ *
290+ * @returns {void }
291+ */
292+ preventDrag ( event ) {
293+ event . preventDefault ( ) ;
294+ }
295+
283296 onPointerDown ( event ) {
284297 // Not the main button.
285298 // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
@@ -407,7 +420,7 @@ export class BlockListBlock extends Component {
407420 < div
408421 ref = { this . bindBlockNode }
409422 onKeyPress = { this . maybeStartTyping }
410- onDragStart = { ( event ) => event . preventDefault ( ) }
423+ onDragStart = { this . preventDrag }
411424 onMouseDown = { this . onPointerDown }
412425 onKeyDown = { this . onKeyDown }
413426 onFocus = { this . onFocus }
You can’t perform that action at this time.
0 commit comments