From ed018ef737379989db8b4c4e782bbc06b57d52f2 Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Tue, 25 Jun 2024 10:59:06 -0500 Subject: [PATCH] Convert nodelist to array for firefox compatability --- .../src/components/block-tools/index.js | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/packages/block-editor/src/components/block-tools/index.js b/packages/block-editor/src/components/block-tools/index.js index b0a90ca3ed176e..0e89e7991320e0 100644 --- a/packages/block-editor/src/components/block-tools/index.js +++ b/packages/block-editor/src/components/block-tools/index.js @@ -164,20 +164,21 @@ export default function BlockTools( { // If there are multiple editors, we need to find the iframe that contains our contentRef to make sure // we're focusing the region that contains this editor. const editorCanvas = - document - .querySelectorAll( 'iframe[name="editor-canvas"]' ) - .values() - .find( ( iframe ) => { - // Find the iframe that contains our contentRef - const iframeDocument = - iframe.contentDocument || - iframe.contentWindow.document; + Array.from( + document + .querySelectorAll( 'iframe[name="editor-canvas"]' ) + .values() + ).find( ( iframe ) => { + // Find the iframe that contains our contentRef + const iframeDocument = + iframe.contentDocument || + iframe.contentWindow.document; - return ( - iframeDocument === - __unstableContentRef.current.ownerDocument - ); - } ) ?? __unstableContentRef.current; + return ( + iframeDocument === + __unstableContentRef.current.ownerDocument + ); + } ) ?? __unstableContentRef.current; // The region is provivided by the editor, not the block-editor. // We should send focus to the region if one is available to reuse the