Skip to content

Conversation

@stdavis
Copy link
Contributor

@stdavis stdavis commented Oct 16, 2025

Closes #9004

It was unclear to me exactly how the project maintainers wanted this to work so I made my best guess and erred on the side of simplicity. I'm happy to update this further with feedback.

Thanks for the awesome project!

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices
    I couldn't find anything about disclosures being disabled.

📝 Test Instructions:

You may test this by going to the "Disclosure Group Example" storybook story and pressing the "Toggle Disabled" button.

🧢 Your Project:

Utah Geospatial Resource Center (UGRC)

Copilot AI review requested due to automatic review settings October 16, 2025 19:37
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue where disabled Disclosure components were not showing their content when the isExpanded prop was set to true. The fix ensures that the isDisabled state doesn't override the visibility of disclosure panels when they are explicitly set to be expanded.

  • Updated the useDisclosure hook to remove the disabled state check from the panel's hidden attribute logic
  • Modified tests to reflect the new expected behavior where disabled disclosures can still show content when expanded
  • Added a new Storybook story to demonstrate and test the fix

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/@react-aria/disclosure/src/useDisclosure.ts Simplified panel visibility logic to only depend on expansion state
packages/react-aria-components/test/Disclosure.test.js Updated test expectations to allow disabled disclosures to show content when expanded
packages/@react-aria/disclosure/test/useDisclosure.test.ts Added test to verify panel remains hidden when toggling disabled state
packages/react-aria-components/stories/DisclosureGroup.stories.tsx New Storybook story for testing disclosure group with disabled state toggle

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@stdavis
Copy link
Contributor Author

stdavis commented Oct 16, 2025

I'm working on getting approvals and direction on signing the CLA...

@stdavis
Copy link
Contributor Author

stdavis commented Oct 16, 2025

Closing and re-opening to retrigger the Signed CLA check...

@stdavis stdavis closed this Oct 16, 2025
@stdavis stdavis reopened this Oct 16, 2025
@stdavis stdavis force-pushed the fix/disabled-disclosures branch from 7df5314 to 716b316 Compare October 16, 2025 20:05
Copy link
Member

@reidbarber reidbarber left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the PR!

@snowystinger snowystinger added this pull request to the merge queue Oct 16, 2025
Merged via the queue into adobe:main with commit 23b3f43 Oct 16, 2025
32 checks passed
devongovett pushed a commit that referenced this pull request Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disclosure incorrectly shows content if isDisabled is toggled

4 participants