From 35e1fae216c3a18c70ab5368c05f1fe781baaae0 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Wed, 5 Oct 2022 11:55:22 +0100 Subject: [PATCH] Prevent empty block toolbars from showing empty slots --- .../src/slot-fill/bubbles-virtually/slot-fill-provider.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/components/src/slot-fill/bubbles-virtually/slot-fill-provider.js b/packages/components/src/slot-fill/bubbles-virtually/slot-fill-provider.js index c25b524079063b..47c31f1906cfa4 100644 --- a/packages/components/src/slot-fill/bubbles-virtually/slot-fill-provider.js +++ b/packages/components/src/slot-fill/bubbles-virtually/slot-fill-provider.js @@ -67,9 +67,11 @@ function useSlotRegistry() { if ( fills.current.get( name ) ) { fills.current.set( name, - fills.current - .get( name ) - .filter( ( fillRef ) => fillRef !== ref ) + valRef( + fills.current + .get( name ) + .filter( ( fillRef ) => fillRef !== ref ) + ) ); } }, [] );