-
Notifications
You must be signed in to change notification settings - Fork 19
fix(menus): Support top & left animations #158
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
Conversation
jzempel
left a comment
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.
@ryanseddon plz review https://github.com/zendeskgarden/css-menus/pull/20 which explains the rationale for using margin to animate and ensure that your changes don't regress the behavior. Also, please grep for c-menu usage throughout the demo pages and check that everything is still working as expected.
austingreendev
left a comment
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.
Approved pending research into the issues that @jzempel pointed out.
|
@jzempel yep this bug has not regressed tested in all supported browsers and it looks good, will grep and test usages throughout demo pages now. |
jzempel
left a comment
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.
@ryanseddon am I reading this right that now a container is needed in order to support the animation? If so, do you consider this to be a major breaking change?
|
@jzempel not really, if someone was going to just use the css of this they'd have to build the logic themselves to correctly position the menu view. This container matches what popper.js does already in our react-component so it's not a breaking change in react. |
Description
This PR is the first step to allow support for top and left animations to work correctly with popper.js in our select & menu components.
Detail
The real change is just using top, left, right & bottom instead of margins.
Popper positions the element using a transform so top, left, right & bottom are relative to that gpu layer and not to the document.
react-menus
Here's this running locally for react-menus
Less important stuff
I added a .prettierrc file that matches react-components.
The demo page needed some changes to support working with the new usage of position properties over using margins to emulate what popper would do.
Checklist
designer as a reviewer)
yarn start)