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

Separate menu placement logic from menu primitive #2975

Merged
merged 4 commits into from
Aug 28, 2018

Conversation

jossmac
Copy link
Collaborator

@jossmac jossmac commented Aug 28, 2018

Apologies for all the white-space changes; prettier had a field day.

Basically this moves the logic for placing and resizing the menu into MenuPlacer, which wraps the Menu primitive (now actually a primitive).

Also, menu placement logic now checks the explicit margin value on the menu element rather than pulling the menuGutter value from theme.

Why?

  • separation of concerns
  • menu primitive can be easily replaced/augmented by consumers [v2]How do I add a menubuffer by version2 ?  #2965
  • max-height constraints weren't being passed on to the MenuList, which was breaking position fixed behaviour when close to the bottom of the viewport

Next

  • needs a bit of cleanup
  • it's now basically a half implemented react-popper substitute; might be worth revisiting

Resolves #2965

explicitly check the margin value on menu element rather than assuming gutter is accurate
Copy link
Collaborator

@gwyneplaine gwyneplaine left a comment

Choose a reason for hiding this comment

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

Just needs an example and fixed tests, otherwise LGTM

@jossmac jossmac merged commit 5fac368 into master Aug 28, 2018
@jossmac jossmac deleted the menu-primitive-cleanup branch August 28, 2018 03:47
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

Successfully merging this pull request may close these issues.

[v2]How do I add a menubuffer by version2 ?
2 participants