Skip to content

Commit

Permalink
ToolsPanel: Allow additional props on ToolsPanel (#36428)
Browse files Browse the repository at this point in the history
* Allow additional props on ToolsPanel
* Add changelog
  • Loading branch information
aaronrobertshaw authored Nov 14, 2021
1 parent 045806f commit cd8aaf8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 4 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Experimental

- Reinstated the ability to pass additional props to the `ToolsPanel` ([36428](https://github.com/WordPress/gutenberg/pull/36428)).

## 19.0.1 (2021-11-07)

### Experimental
Expand Down
7 changes: 2 additions & 5 deletions packages/components/src/tools-panel/tools-panel/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@ const ToolsPanel = (
panelContext,
resetAllItems,
toggleItem,
className,
...toolsPanelProps
} = useToolsPanel( props );

// Props are not directly passed through to avoid exposing Grid props
// until agreement has been reached on how ToolsPanel layout should be
// handled.
return (
<Grid columns={ 2 } className={ className } ref={ forwardedRef }>
<Grid { ...toolsPanelProps } columns={ 2 } ref={ forwardedRef }>
<ToolsPanelContext.Provider value={ panelContext }>
<ToolsPanelHeader
label={ label }
Expand Down

0 comments on commit cd8aaf8

Please sign in to comment.