Skip to content

Conversation

@Infinite-Null
Copy link
Contributor

@Infinite-Null Infinite-Null commented Jun 6, 2025

What?

Part of: #44401

This PR updates the Dropdown component within the media-preview.js to use the placement prop instead of the deprecated position prop for its popover.

Why?

The Popover component, used internally by Dropdown, has deprecated the position prop in favor of placement. This update brings media-preview.js in line with the latest standards.

How?

Changed this:

const MEDIA_OPTIONS_POPOVER_PROPS = {
        position: 'bottom left',
	className:
		'block-editor-inserter__media-list__item-preview-options__popover',
};

To:

const MEDIA_OPTIONS_POPOVER_PROPS = {
	placement: 'bottom-end',
	className:
		'block-editor-inserter__media-list__item-preview-options__popover',
};

Testing Instructions

To test this change, I made the following adjustments:
2. Go to Inserter > Openverse
3. Select an image and click on the 3-dot menu:
4. Verify that report button is in right placement.

Screenshots:

image

@Infinite-Null Infinite-Null requested a review from ellatrix as a code owner June 6, 2025 09:40
@github-actions
Copy link

github-actions bot commented Jun 6, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Infinite-Null <[email protected]>
Co-authored-by: Mamaduka <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano t-hamano added [Type] Code Quality Issues or PRs that relate to code quality [Package] Block editor /packages/block-editor labels Jun 9, 2025
Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @Infinite-Null!

@Mamaduka Mamaduka added the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Jun 12, 2025
@github-actions github-actions bot removed the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Jun 12, 2025
@Mamaduka Mamaduka merged commit eea7380 into WordPress:trunk Jun 12, 2025
70 of 71 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.1 milestone Jun 12, 2025
chriszarate pushed a commit to chriszarate/gutenberg that referenced this pull request Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block editor /packages/block-editor [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants