From 76f61df275ff88b88a5a9a1bbfdcf6b1bf2087c1 Mon Sep 17 00:00:00 2001 From: Ella Date: Fri, 29 Nov 2024 12:07:55 +0100 Subject: [PATCH] add ff comment --- .../use-firefox-draggable-compatibility.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/block-editor/src/components/block-list/use-block-props/use-firefox-draggable-compatibility.js b/packages/block-editor/src/components/block-list/use-block-props/use-firefox-draggable-compatibility.js index ad67e9d342632..5fa07fb9be604 100644 --- a/packages/block-editor/src/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +++ b/packages/block-editor/src/components/block-list/use-block-props/use-firefox-draggable-compatibility.js @@ -3,6 +3,14 @@ */ import { useRefEffect } from '@wordpress/compose'; +/** + * In Firefox, the `draggable` and `contenteditable` attributes don't play well + * together. When `contenteditable` is within a `draggable` element, selection + * doesn't get set in the right place. The only solution is to temporarily + * remove the `draggable` attribute clicking inside `contenteditable` elements. + * + * @return {Function} Cleanup function. + */ export function useFirefoxDraggableCompatibility() { return useRefEffect( ( node ) => { function onDown( event ) {