From 63efc3918236cacf1b025a6a5ba294bf7084c81c Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Thu, 18 Apr 2024 15:36:47 +1000 Subject: [PATCH] List View: Fix stuck dragging mode in UI in Firefox when dealing with deeply nested lists --- .../src/components/list-view/use-list-view-drop-zone.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/block-editor/src/components/list-view/use-list-view-drop-zone.js b/packages/block-editor/src/components/list-view/use-list-view-drop-zone.js index 3354b3f41d391..67908a43fc3c0 100644 --- a/packages/block-editor/src/components/list-view/use-list-view-drop-zone.js +++ b/packages/block-editor/src/components/list-view/use-list-view-drop-zone.js @@ -556,9 +556,14 @@ export default function useListViewDropZone( { const ref = useDropZone( { dropZoneElement, onDrop( event ) { + throttled.cancel(); if ( target ) { onBlockDrop( event ); } + // Use `undefined` value to indicate that the drag has concluded. + // This allows styling rules that are active only when a user is + // dragging to be removed. + setTarget( undefined ); }, onDragLeave() { throttled.cancel();