From 744a466b7424b32788d8c1765456a1ed437980b3 Mon Sep 17 00:00:00 2001 From: Tetsuaki Hamano Date: Wed, 17 May 2023 00:17:58 +0900 Subject: [PATCH] Continue event processing only if within a specific element --- .../src/components/rich-text/use-firefox-compat.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/block-editor/src/components/rich-text/use-firefox-compat.js b/packages/block-editor/src/components/rich-text/use-firefox-compat.js index 5a4355d92885a..f9057c7116aac 100644 --- a/packages/block-editor/src/components/rich-text/use-firefox-compat.js +++ b/packages/block-editor/src/components/rich-text/use-firefox-compat.js @@ -46,6 +46,10 @@ export function useFirefoxCompat( props ) { return; } + if ( element.closest( 'button, summary' ) === null ) { + return; + } + const { value, onChange } = propsRef.current; onChange( insert( value, ' ' ) ); event.preventDefault();