diff --git a/packages/block-editor/src/components/block-alignment-matrix-control/index.js b/packages/block-editor/src/components/block-alignment-matrix-control/index.js index 6ea7b2a49c8a95..8acb125a1ad931 100644 --- a/packages/block-editor/src/components/block-alignment-matrix-control/index.js +++ b/packages/block-editor/src/components/block-alignment-matrix-control/index.js @@ -23,8 +23,7 @@ function BlockAlignmentMatrixControl( props ) { return ( { const openOnArrowDown = ( event ) => { if ( ! isOpen && event.keyCode === DOWN ) { diff --git a/packages/block-editor/src/components/block-navigation/dropdown.js b/packages/block-editor/src/components/block-navigation/dropdown.js index 8574d66e943160..e04589d002c539 100644 --- a/packages/block-editor/src/components/block-navigation/dropdown.js +++ b/packages/block-editor/src/components/block-navigation/dropdown.js @@ -56,7 +56,7 @@ function BlockNavigationDropdown( { isDisabled, ...props }, ref ) { return ( ( { return ( ) } - position="bottom right" + popoverProps={ { placement: 'bottom-start' } } renderContent={ () => ( <> diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 661decd6d97408..8fd6fe51c38ab8 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Enhancements + +- `Dropdown`: deprecate `position` prop, use `popoverProps` instead ([46865](https://github.com/WordPress/gutenberg/pull/46865)). + ### Internal - `Toolbar`: move all subcomponents under the same folder ([46951](https://github.com/WordPress/gutenberg/pull/46951)). diff --git a/packages/components/src/dropdown/README.md b/packages/components/src/dropdown/README.md index 62482f398e26ca..3dd321ed900128 100644 --- a/packages/components/src/dropdown/README.md +++ b/packages/components/src/dropdown/README.md @@ -13,7 +13,7 @@ const MyDropdown = () => ( ( * ) } - * renderContent={ () =>
This is the content of the popover.
} + * renderContent={ () =>
This is the content of the dropdown.
} * /> * ); * ``` diff --git a/packages/components/src/dropdown/stories/index.tsx b/packages/components/src/dropdown/stories/index.tsx index ff155b6c42b5b9..5f21f7d4b30d34 100644 --- a/packages/components/src/dropdown/stories/index.tsx +++ b/packages/components/src/dropdown/stories/index.tsx @@ -16,11 +16,12 @@ const meta: ComponentMeta< typeof Dropdown > = { subcomponents: { DropdownContentWrapper }, argTypes: { focusOnMount: { + options: [ 'firstElement', true, false ], control: { type: 'radio', - options: [ 'firstElement', true, false ], }, }, + position: { control: { type: null } }, renderContent: { control: { type: null } }, renderToggle: { control: { type: null } }, }, @@ -42,7 +43,6 @@ const Template: ComponentStory< typeof Dropdown > = ( args ) => { export const Default: ComponentStory< typeof Dropdown > = Template.bind( {} ); Default.args = { - position: 'bottom right', renderToggle: ( { isOpen, onToggle } ) => ( { hasOptions ? ( (