Skip to content
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

Unnecessary RightNav translation at the breakpoint #5

Open
imkarthikb opened this issue Sep 26, 2020 · 2 comments
Open

Unnecessary RightNav translation at the breakpoint #5

imkarthikb opened this issue Sep 26, 2020 · 2 comments

Comments

@imkarthikb
Copy link

imkarthikb commented Sep 26, 2020

I'm new to web frontend and really like this responsive navbar implementation but I notice an unncessary translation of the RightNav component when we adjust the browser width at the breakpoint.

The way to reproduce this is - Close the RightNav (if open) and adjust the browser width around the breakpoint (ie., 768px). We notice that the RightNav translates even though it is closed.

So I understand that the translation is causing this but it is needed -

transform: ${({ open }) => open ? 'translateX(0)' : 'translateX(100%)'};

I tried to play around with visibility and opacity which does not seem to work, whereas display works but it overrides the transition we have. So I dont know the severity (chances of people actually encountering this one) but any way to avoid this ?

@paulobr4z
Copy link

transform: ${({ open }) => open ? 'translateX(-300px)' : 'translateX(0px)'};
 right: -300px;

@boomspot
Copy link

boomspot commented Jul 8, 2021

transform: ${({ open }) => open ? 'translateX(-300px)' : 'translateX(0px)'};
 right: -300px;

This worked for me. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants