Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Toolbar: do not set variant prop on popover (rely on context system…
… instead)
  • Loading branch information
ciampo committed Jun 7, 2023
commit 2e4d8204b86b604631fca415997bb9f8055a9711
1 change: 1 addition & 0 deletions packages/components/src/dropdown-menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { menu } from '@wordpress/icons';
/**
* Internal dependencies
*/
import { contextConnectWithoutRef, useContextSystem } from '../ui/context';
import Button from '../button';
import Dropdown from '../dropdown';
import { NavigableMenu } from '../navigable-container';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ function ToolbarDropdownMenu( props, ref ) {
<DropdownMenu
{ ...props }
popoverProps={ {
variant: 'toolbar',
...props.popoverProps,
} }
toggleProps={ toolbarItemProps }
Expand Down
8 changes: 2 additions & 6 deletions packages/components/src/toolbar/toolbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,10 @@ import {
ContextSystemProvider,
} from '../../ui/context';

// TODO:
// - (optional) make the legacy `DropdownMenu` read the context variable
// - swap the legacy `DropdownMenu` with the new version of the component
// once it's stable
// TODO: swap the legacy `DropdownMenu` with the new version of the component
// once it's stable
const CONTEXT_SYSTEM_VALUE = {
DropdownMenu: {
// Note: the legacy `DropdownMenu` component is not yet reactive to this
// context variant. See https://github.com/WordPress/gutenberg/pull/51097.
variant: 'toolbar',
},
};
Expand Down