From 5bc64ba6d36c077f2b314099ee537f313dc2f2a7 Mon Sep 17 00:00:00 2001 From: Haz Date: Fri, 22 Jan 2021 08:38:47 +0100 Subject: [PATCH] Make sure toggleProps doesn't replace important props on ToolbarGroup (#28401) --- .../src/toolbar-group/toolbar-group-collapsed.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/components/src/toolbar-group/toolbar-group-collapsed.js b/packages/components/src/toolbar-group/toolbar-group-collapsed.js index e78caa97113474..c671a4dd00f99f 100644 --- a/packages/components/src/toolbar-group/toolbar-group-collapsed.js +++ b/packages/components/src/toolbar-group/toolbar-group-collapsed.js @@ -20,7 +20,6 @@ function ToolbarGroupCollapsed( { controls = [], toggleProps, ...props } ) { controls={ controls } toggleProps={ { ...internalToggleProps, - ...toggleProps, 'data-toolbar-item': true, } } { ...props } @@ -28,10 +27,12 @@ function ToolbarGroupCollapsed( { controls = [], toggleProps, ...props } ) { ); if ( accessibleToolbarState ) { - return { renderDropdownMenu }; + return ( + { renderDropdownMenu } + ); } - return renderDropdownMenu(); + return renderDropdownMenu( toggleProps ); } export default ToolbarGroupCollapsed;