Skip to content

Backward compatibility issue with SVG icons on DropdownMenu component #56448

@renatho

Description

@renatho

Description

When dropdown menu contains SVG icons, it used to work well. But now it's not setting the SVG width and height, so depending on the svg it's broken.

Step-by-step reproduction instructions

  1. Use the DropdownMenu component with the controls prop. You can use the example from https://developer.wordpress.org/block-editor/reference-guides/components/dropdown-menu/#usage-2.
  2. Check that the icons are broken when rendering.

Screenshots, screen recording, code snippet

Before (when it used to work - tested in tag v16.0.0):
Screenshot 2023-11-22 at 15 29 24

Currently:
Screenshot 2023-11-22 at 15 30 00

(This screenshot is from Sensei. If you test it there you will see it a little different - big icons. The reason is that I removed other related styles we have in Sensei to have a more generic scenario)

Environment info

  • WordPress 6.4 / Gutenberg 17.1.0.
  • Chrome
  • OSX

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

Labels

[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions