-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
dropdown menu using popover #2150
Conversation
1e9b812
to
e633295
Compare
@oliviertassinari - you'll be pleased to hear that this is the last PR from #1845! |
Will fix #1311 |
@@ -128,8 +128,9 @@ const DropDownIcon = React.createClass({ | |||
); | |||
}, | |||
|
|||
_onControlClick() { | |||
_onControlClick(e) { |
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.
Can we use event
to be more explicit?
Looking at the material spec (https://www.google.com/design/spec/components/menus.html#menus-usage) I think that the opening animation is wrong. It should from top to bottom and not from top left to bottom right. |
@oliviertassinari - this one is proving difficult, the animate logic in popover is fairly hardcoded presently, which was based on the |
@oliviertassinari thoughts on using https://github.com/twitter-fabric/velocity-react for animations (starting with the popover)? |
What about https://github.com/chenglou/react-motion ? |
I hope this can be merged earlier to fix basic issues such as #2220 #2364 #642 I'm afraid there won't be a quick solution to achieve perfect animation. Also, have a look at the animation for |
e229770
to
84614f0
Compare
@oliviertassinari - this is good to review again |
@oliviertassinari Please review this, we need this to close like 20 issues 😄 |
Oups, I have forgotten about this one! |
I'm adding a |
import ThemeManager from '../styles/theme-manager'; | ||
import Paper from '../paper'; | ||
|
||
const PopoverAnimation = React.createClass({ |
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.
What do you think about PopoverAnimationFromTop
?
|
ok - think the setTimeout issue is sorted 😄 |
82ceb5d
to
b918a45
Compare
@@ -58,6 +60,7 @@ const Popover = React.createClass({ | |||
|
|||
getInitialState() { | |||
this.setPlacementThrottled = throttle(this.setPlacement, 100); | |||
this.setPlacementScrolling = throttle(this.setPlacement.bind(this, true), 100); |
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.
setPlacementThrottledScrolled
?
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.
this broke scrolling. renaming setPlacementScrolling
to setPlacementThrottledScrolled
fixes it.
@chrismcv That's preaty good! We are almost there. |
@chrismcv Nice work 👍 👍 👍 |
b918a45
to
01fe957
Compare
@oliviertassinari - those last 2 changes are done - i've squashed as well - anything else you need? |
@chrismcv Thanks! The source code looks ok 👍. |
@oliviertassinari I already did. it works fine. |
Thank you @chrismcv 👍 👍 🎉 🎉 |
and you guys too! |
Do you plan on implementing scrolling for the dropdown? |
Isn't this already implemented? (checkout the doc) |
@oliviertassinari Looks like it only works if you specify a maxHeight which is OK. Thanks. |
This one has 1 issue.
Because the menu-items aren't rendered or on the DOM until the popover is open, the autoWidth can't work the same way. Please have a look and make sure you're happy with how it's behaving before merging. Open to suggestions for fixes.