Skip to content

Fix radix warnings on side modal #2536

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

Merged
merged 1 commit into from
Nov 7, 2024
Merged

Fix radix warnings on side modal #2536

merged 1 commit into from
Nov 7, 2024

Conversation

david-crespo
Copy link
Collaborator

In local dev, Radix was giving a spurious error and a technically true but pointless warning on our side modal. This PR gets rid of both.

image

Copy link

vercel bot commented Nov 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
console ✅ Ready (Inspect) Visit Preview Nov 7, 2024 9:19pm

)}
</>
<div className="items-top mb-4 mt-8">
<Dialog.Title className="flex w-full items-center justify-between break-words pr-8 text-sans-2xl">
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Dialog.Title without asChild renders as an h2. Putting it directly around the title itself makes a lot more sense here.

@@ -30,7 +30,7 @@ export function usePopoverZIndex() {
}

export type SideModalProps = {
title?: string
title: string
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Title did not need to be optional. We always have a title.

@@ -53,7 +53,6 @@ export function SideModal({
animate = true,
errors,
}: SideModalProps) {
const titleId = 'side-modal-title'
Copy link
Collaborator Author

@david-crespo david-crespo Nov 7, 2024

Choose a reason for hiding this comment

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

This was used to hook up the accessible title to the dialog, but Radix takes care of that for us.

image

title={errors.length > 1 ? 'Errors' : 'Error'}
/>
</div>
)}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

why were errors inside the title????

}
title={errors.length > 1 ? 'Errors' : 'Error'}
/>
</div>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I confirmed everything looks the same as main when there are errors.

image

@david-crespo david-crespo merged commit 5edf89e into main Nov 7, 2024
8 checks passed
@david-crespo david-crespo deleted the fix-radix-warnings branch November 7, 2024 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant