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

fix: fix position of menu when dimensions change #3521

Conversation

mathias-berg
Copy link
Contributor

Summary

The dimensions was set outside the component and therefore didn't change when the screen size was adjusted.
This was introduced in in rc9 so I just moved it back to where it was before when it worked.

Fixes #3515

@callstack-bot
Copy link

callstack-bot commented Dec 10, 2022

Hey @mathias-berg, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

@mathias-berg
Copy link
Contributor Author

mathias-berg commented Dec 11, 2022

@lukewalczak
Is this solution good for you or should I change it to an event listener and set the values in state instead?

@lukewalczak
Copy link
Member

Hey @mathias-berg, thanks for fix! We can stick with the current approach, however I would like to confirm whether it doesnt interfere with the previously fixed issue.

@lukewalczak
Copy link
Member

Unfortunately, the current approach with updating window dimensions breaks the Menu example when opening the keyboard, from the previous issue, presented on that snack. Looks like we need to find another solution which covers both cases.

@mathias-berg
Copy link
Contributor Author

I will look at this tonight to see if I find a solution.

@mathias-berg
Copy link
Contributor Author

Did a lot of investigating on this last night and found a solution that works. I will do some more testing and then update this PR.

@mathias-berg
Copy link
Contributor Author

Changes are up now, please have a look.

@lukewalczak
Copy link
Member

Thanks @mathias-berg! I will review & test in my spare time

src/components/Menu/Menu.tsx Outdated Show resolved Hide resolved
src/components/Menu/Menu.tsx Outdated Show resolved Hide resolved
src/components/Menu/Menu.tsx Outdated Show resolved Hide resolved
src/components/Menu/Menu.tsx Outdated Show resolved Hide resolved
src/components/Menu/Menu.tsx Outdated Show resolved Hide resolved
src/components/Menu/Menu.tsx Outdated Show resolved Hide resolved
Copy link
Member

@lukewalczak lukewalczak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @mathias-berg, thanks for the help with fixing the issue! 🎉

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

Successfully merging this pull request may close these issues.

Menu position is wrong when changing size of window
3 participants