From 6e73da6d49ad1b389aeb0c6eb8b580fc5613ddcc Mon Sep 17 00:00:00 2001 From: EduardF1 Date: Sat, 30 May 2026 02:29:23 +0200 Subject: [PATCH 1/2] fix(RAC): clear pressed state on DialogTrigger when dialog opens MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a modal dialog is opened via DialogTrigger, the trigger button remains visually stuck in a 'pressed' state because isPressed was set to state.isOpen. This causes the press animation to never complete, giving the appearance of a frozen press state on the button. This fix sets isPressed to false unconditionally in DialogTrigger, matching the behavior already implemented in Spectrum 2's DialogTrigger which wraps PressResponder with isPressed={false} as a workaround. For modal dialogs (which open an overlay above the page), the trigger button should return to its normal state once the dialog is open — the dialog itself provides the visual context that an action was taken. Fixes #8339 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- packages/react-aria-components/src/Dialog.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-aria-components/src/Dialog.tsx b/packages/react-aria-components/src/Dialog.tsx index 7baac685eeb..fc513eb330d 100644 --- a/packages/react-aria-components/src/Dialog.tsx +++ b/packages/react-aria-components/src/Dialog.tsx @@ -106,7 +106,7 @@ export function DialogTrigger(props: DialogTriggerProps): JSX.Element { } ] ]}> - + {props.children} From 0f9f9d1d12529d5f391f4d4ed95b5a96207df6c3 Mon Sep 17 00:00:00 2001 From: EduardF1 <50618110+EduardF1@users.noreply.github.com> Date: Sat, 30 May 2026 04:06:53 +0200 Subject: [PATCH 2/2] fix(dialog): update popover pressed state test assertion With isPressed={false} in PressResponder, the trigger button no longer reflects the dialog open state via data-pressed. Update the test to match the new intentional behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- packages/react-aria-components/test/Dialog.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-aria-components/test/Dialog.test.js b/packages/react-aria-components/test/Dialog.test.js index 9621e7c90d8..6982bb734e4 100644 --- a/packages/react-aria-components/test/Dialog.test.js +++ b/packages/react-aria-components/test/Dialog.test.js @@ -172,7 +172,7 @@ describe('Dialog', () => { let dialogTester = testUtilUser.createTester('Dialog', {root: button, overlayType: 'popover'}); await dialogTester.open(); - expect(button).toHaveAttribute('data-pressed'); + expect(button).not.toHaveAttribute('data-pressed'); let dialog = dialogTester.getDialog(); let heading = getByRole('heading');