Closed ItsJonQ closed 3 years ago
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/itsjonq/g2/r339d2pfb
✅ Preview: https://g2-git-fix-panel-initial-visible.itsjonq.vercel.app
@ItsJonQ What's the best way to test this?
@saramarcondes Ah! My apologies 🙏 .
Make sure these Panels (Accordions) still sync with each other (when open/closing) https://g2-git-fix-panel-initial-visible.itsjonq.vercel.app/iframe.html?id=components-accordion--default&viewMode=story
Ensure this Panel is initially expanded (and can be closed/opened) https://g2-git-fix-panel-initial-visible.itsjonq.vercel.app/iframe.html?id=components-panel--default&viewMode=story
@ItsJonQ So it appears that the accordions only sync when they're opening, but they do not close together. Is that the intended behavior?
but they do not close together. Is that the intended behavior?
🤦 no, haha. They should be closing together as well.
I think a good order would be to merge your https://github.com/ItsJonQ/g2/pull/255 update, and continue with this PR.
@saramarcondes Investigated! It looks like it's an existing issue. I've added a todo for a fix. We can do it in a follow up :)
This update fixes the visible prop rendering for Panels OUTSIDE of Accordions.
There was a bug in the
useAccordion
hook that prevent thevisible
prop from being correctly evaluated without rendering within an Accordion Context.