-
Notifications
You must be signed in to change notification settings - Fork 5k
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
DS implementation - SideNav #13063
DS implementation - SideNav #13063
Conversation
✅ Deploy Preview for ethereumorg ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
The open and closing work differently on some items. screen cast done on brave Screen.Recording.2024-06-12.at.12.23.57.mov |
So, you are right, we have 2 types of expandable items:
The first one, you can click the whole row and it will expand the content.
|
This feels weird a bit like a bug. If we need to have 2 interactions on the same button, we need to be clearer about what does what. Screen.Recording.2024-06-12.at.15.17.05.movhere we open the link and open the accordion always. is it possible to change this? or it's a big hack. We might as well just change the component. |
@nloureiro correct. I get it now. It works the first time you click on it because it navigates to that page and then expands the content. But when you collapse and try to expand it again by clicking on the text, it doesn't expand. Yeah, I think we can do that, shouldn't be a problem. |
Can we default to these being open? Seeing an animation on page load where all of these nav accordions start collapsed and then animate open. |
However, this does not resolve the delayed expanded, which I believe is coming from above the accordion. If you test the Chakra Accordion component in static isolation, |
The reason I'm using the controlled version is because we need to open it manually when internal navigation happens. When you click on an element that is also a link, we want to navigate to that doc page and also want to expand the content. You can see the Regarding the delayed expanded, I tried mounting an empty Accordion on an empty test page (and even hardcoding In SB I can see this on mounting: demo.mp4Seems that the top level items are expanded correctly but the nested one is expanded in the next render...
Nice catch, fixed! |
@wackerow thanks for the detailed review and snapshots. For now, as I said, I don't really know if we can show them as expanded by default. I'll keep debugging and testing to see if there's anything missing, but I'd say: if we can't fix this, or the accordion can't be rendered as expanded by default, we can revert and use the previous implementation + the DS styles. I will consider this issue a blocker. We should be able to render this list with an open state from the server side. ===== |
@TylerAPfledderer I've tested the Accordion on an empty project and can confirm that the Accordion only expands on the client side (you can clearly see this by disabling js in your browser). It seems that we can't render the expanded version on the server side. We might have to revert the Accordion at least on this component. LMK if you have any other ideas or if you think there is another way to do this. |
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.
@TylerAPfledderer I've tested the Accordion on an empty project and can confirm that the Accordion only expands on the client side (you can clearly see this by disabling js in your browser). It seems that we can't render the expanded version on the server side.
We might have to revert the Accordion at least on this component. LMK if you have any other ideas or if you think there is another way to do this.
I made an inquiry with the Chakra team to find out if this is expected behavior that is being addressed in Chakra v3. I'm not quite familiar as to why this couldn't be done server-side. Also inquired if there is a workaround to be offered or if the component in the v2 package can be patched.
@pettinarip after checking with some Chakra folks, this is probably a bug within Accordion. But at the moment, I'll need to do some internal testing to confirm.
|
@TylerAPfledderer thanks! ok, good to know. I'll revert the Accordion implementation for now and keep using the previous implementation but using the new DS styles. |
@pettinarip sounds good. I'll get back to you either in this PR or discord if I have any update on what I find. |
Closing in favor of #13230 |
Description
Adds the new sidenav using the chakra accordion.
Preview URL
Related issue