-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix: Support hidden="until-found" in DisclosureGroup #7199
Conversation
Controlled doesn't seem to quite work right? https://reactspectrum.blob.core.windows.net/reactspectrum/f0457c575ce0bc023f31532191d0d5e809ccc052/storybook-s2/index.html?path=/story/accordion--controlled-open |
## API Changes
@react-aria/disclosure/@react-aria/disclosure:useDisclosure useDisclosure {
props: AriaDisclosureProps
state: DisclosureState
- ref?: RefObject<Element | null>
+ ref: RefObject<Element | null>
returnVal: undefined
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested in Chrome, appears to be working as expected.
- Uncontrolled, opens when text is found
- Uncontrolled allows multiple expanded, all of them open sequentially as expected and stay open
- Disabled disclosures do not open even if text is in them
- Controlled, opens when text is found, key is updated. Can open other panel and redo my actions
- Controlled works with allows multiple expanded
- Controlled always open does not appear to ever open the accordion with the text we're looking for
Any other cases I should be trying?
I did notice that some of the Accordion s2 stories have disclosures without id
's, not part of this PR, but I thought those were required?
@@ -172,8 +172,9 @@ describe('useDisclosure', () => { | |||
}); | |||
|
|||
expect(result.current.state.isExpanded).toBe(false); | |||
expect(ref.current.getAttribute('hidden')).toBeNull(); | |||
expect(onExpandedChange).not.toHaveBeenCalled(); | |||
expect(ref.current.getAttribute('hidden')).toBe('until-found'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I listed a lot of test cases in my review, can we add them either here or in followup?
✅ Pull Request Checklist:
📝 Test Instructions:
Test Ctrl+F behavior for all S2 Accordion and Disclosure stories.
🧢 Your Project: