-
-
Notifications
You must be signed in to change notification settings - Fork 430
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(components/accordion): allow opened panel to be closed #684
fix(components/accordion): allow opened panel to be closed #684
Conversation
… after being opened Accordion content can now be closed and opened leaving all items collapsed. themesberg#618
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #684 +/- ##
==========================================
- Coverage 99.42% 99.41% -0.02%
==========================================
Files 130 130
Lines 6448 6457 +9
Branches 485 487 +2
==========================================
+ Hits 6411 6419 +8
- Misses 37 38 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
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.
@mufasubhai seems to work. I would like however to see some unit tests for it. :)
Sounds good @rluders. I'll add some over the next couple days. Thanks for the feedback! |
still missing the unit tests that you promised me. 💔 🤣 |
Oh jeez. It's been a while, hasn't it? My apologies. I'll try and update these today or tomorrow! |
recreated under pull request 705 (re-synced fork prior to creating the new PR.) Let me know if there are any other changes you need made. Sorry for the delay! |
… accordion tests (#705) * fix(accordion.tsx): fixed bug where Accordion.Content would not close after being opened Accordion content can now be closed and opened leaving all items collapsed. #618 * style(accordion.tsx): update spacing after adding toggleOpen function * test(accordion.spec.tsx): add tests for accordion click to toggle #684 * style(accordion.spec): prettier * style(accordion.tsx): change conditional to ternary for toggleOpen * style(accordion.tsx): prettier update for cloneElement format --------- Co-authored-by: Adrian Apodaca <[email protected]>
Description
setOpen function didn't allow for current value to be removed if the item being clicked on was already open. As a result, it was not possible to close an accordion drawer by toggling it.
Added toggleOpen function to set out of range value for open if the current target was already open.
Fixes #618
Type of change
Please delete options that are not relevant.
Please document the breaking changes if suitable.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: