From efe0a9ea417413c76635ba1e0fda5c52ff551ec9 Mon Sep 17 00:00:00 2001 From: Renatho De Carli Rosa Date: Wed, 16 Oct 2024 10:16:55 -0300 Subject: [PATCH] Refactor html element selector --- packages/block-library/src/navigation/edit/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/navigation/edit/index.js b/packages/block-library/src/navigation/edit/index.js index 7fb4128084c6c..ea78de5969ef9 100644 --- a/packages/block-library/src/navigation/edit/index.js +++ b/packages/block-library/src/navigation/edit/index.js @@ -82,7 +82,7 @@ function useResponsiveMenu( navRef ) { return; } - const htmlElement = navRef.current.closest( 'html' ); + const htmlElement = navRef.current.ownerDocument.documentElement; // Add a `has-modal-open` class to the when the responsive // menu is open. This reproduces the same behavior of the frontend.