Skip to content

Commit

Permalink
Make sure toggleProps doesn't replace important props on ToolbarGroup (
Browse files Browse the repository at this point in the history
  • Loading branch information
diegohaz authored Jan 22, 2021
1 parent cf62785 commit 5bc64ba
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@ function ToolbarGroupCollapsed( { controls = [], toggleProps, ...props } ) {
controls={ controls }
toggleProps={ {
...internalToggleProps,
...toggleProps,
'data-toolbar-item': true,
} }
{ ...props }
/>
);

if ( accessibleToolbarState ) {
return <ToolbarItem>{ renderDropdownMenu }</ToolbarItem>;
return (
<ToolbarItem { ...toggleProps }>{ renderDropdownMenu }</ToolbarItem>
);
}

return renderDropdownMenu();
return renderDropdownMenu( toggleProps );
}

export default ToolbarGroupCollapsed;

0 comments on commit 5bc64ba

Please sign in to comment.