-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
feat(TransitionablePortal): add component #2155
Conversation
…React into feat/transitionable-portal
@levithomason It's ready for initial review. NamingI'm not sure that I chose the best name for the component, too many characters as I think. BehaviourI have trouble with I also need to add more tests after initial review. |
321d64c
to
52c3eea
Compare
Codecov Report
@@ Coverage Diff @@
## master #2155 +/- ##
==========================================
+ Coverage 99.73% 99.73% +<.01%
==========================================
Files 151 152 +1
Lines 2621 2651 +30
==========================================
+ Hits 2614 2644 +30
Misses 7 7
Continue to review full report at Codecov.
|
OK, thanks. Skimming through PRs/Issues right now trying to get a release out. I will come back to this one as it seems like it needs more attention than I have at the moment. |
Reviewing and testing... |
componentWillReceiveProps({ open }) { | ||
debug('componentWillReceiveProps()', { open }) | ||
|
||
// Heads up! We apply `open` prop only when it's defined, otherwise it will break autocontrolled Portal |
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 component does not extend ACC, is this still valid?
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.
Resolved, see my next...
|
||
// Heads up! We simply call `onClose` when component is controlled with `open` prop. | ||
// But, when it's autocontrolled we should change the state to opposite to keep the transition | ||
// queue |
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 component does not extend ACC, is this still valid?
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.
Oh, I see. This is referring to the underlying Portal which extends ACC.
My first thought was just to add an Your solution seems like a sane approach to this problem for now. NameIt's great. I'd rather have it verbose and clear than short. Perhaps since we have BehaviorAh, this is tricky. Clicking the trigger immediately calls Changing the example from Suggest FixWe probably shouldn't expose the |
@levithomason I've made changes, thanks for your suggestions. Ready for review |
Released in |
Why?
Modal
requires the pageDimmer
Dimmer
requires transitions, but it usesPortal
Portal
unmounts components when closesSolution
We need to simply wrap
Portal
into the new components that respectsTransition
's callbacks.But, we can use
Portal
?Portal
is already complicated, this will be overhang for it as callback handling is quite complex.