Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global Styles: Fix incorrect usage of ItemGroup in the Background image panel #68631

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@ function InspectorImagePreviewItem( {
}
}, [ toggleProps?.isOpen, onToggleCallback ] );
return (
<ItemGroup as={ as } className={ className } { ...toggleProps }>
<ItemGroup
role="none"
Copy link
Contributor

Choose a reason for hiding this comment

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

When the background image is set, ItemGroup is rendered as a button element. The role=none would override the native button role, which isn't okay.

Copy link
Contributor Author

@im3dabasia im3dabasia Feb 6, 2025

Choose a reason for hiding this comment

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

Maybe we can solve this with imgUrl ? "none" : "button". I'll try it out and update you.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or maybe based on the as prop. However, this would be just a temporary workaround.
This component is still used incorrectly and against its documentation. We can implement a temporary fix but the long term goal is to not allow this kind of incorrect usage.

as={ as }
className={ className }
{ ...toggleProps }
>
<HStack
justify="flex-start"
as="span"
Expand Down
Loading