Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions packages/react-aria-components/src/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export function DialogTrigger(props: DialogTriggerProps): JSX.Element {
[PopoverContext, {
trigger: 'DialogTrigger',
triggerRef: buttonRef,
id: overlayProps.id,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Now we are sending the id to both DialogContext and PopoverContext. This is causing the test failures. We could potentially set id to undefined on DialogContext and only send it to PopoverContext, but not sure.

'aria-labelledby': overlayProps['aria-labelledby'],
style: {'--trigger-width': buttonWidth} as React.CSSProperties
}]
Expand Down
4 changes: 4 additions & 0 deletions packages/react-aria-components/test/Popover.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ describe('Popover', () => {
expect(dialog).toBeInTheDocument();
expect(dialog.closest('.react-aria-Popover')).toHaveAttribute('data-trigger', 'DialogTrigger');

let popover = dialog.closest('.react-aria-Popover');
expect(button).toHaveAttribute('aria-controls');
expect(popover).toHaveAttribute('id', button.getAttribute('aria-controls'));

await user.click(document.body);

expect(dialog).not.toBeInTheDocument();
Expand Down
Loading