From 8611debd0f31af0b14cd61bfc9426ad3a690bed0 Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Tue, 7 Sep 2021 10:08:52 +0100 Subject: [PATCH 1/2] Only capture toolbars on parent Nav block when not in vertical mode --- packages/block-library/src/navigation/edit.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/navigation/edit.js b/packages/block-library/src/navigation/edit.js index f5d7a1c44f656..5bd7c55321740 100644 --- a/packages/block-library/src/navigation/edit.js +++ b/packages/block-library/src/navigation/edit.js @@ -158,7 +158,8 @@ function Navigation( { isSelected ? InnerBlocks.DefaultAppender : false, - __experimentalCaptureToolbars: true, + __experimentalCaptureToolbars: + attributes.orientation !== 'vertical', // Template lock set to false here so that the Nav // Block on the experimental menus screen does not // inherit templateLock={ 'all' }. From c1d89820f684f954c0b2637b858cf4d538e559ed Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Wed, 8 Sep 2021 09:48:32 +0100 Subject: [PATCH 2/2] Add code comment for context and clarity about reason for change --- packages/block-library/src/navigation/edit.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/block-library/src/navigation/edit.js b/packages/block-library/src/navigation/edit.js index 5bd7c55321740..b10009ac4f0f9 100644 --- a/packages/block-library/src/navigation/edit.js +++ b/packages/block-library/src/navigation/edit.js @@ -158,6 +158,9 @@ function Navigation( { isSelected ? InnerBlocks.DefaultAppender : false, + // Ensure block toolbar is not too far removed from item + // being edited when in vertical mode. + // see: https://github.com/WordPress/gutenberg/pull/34615. __experimentalCaptureToolbars: attributes.orientation !== 'vertical', // Template lock set to false here so that the Nav