-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[Overlay] better lifecycle props for all overlay components #2581
Conversation
- 4 methods passed directly to CSSTransition to leverage their reliable code - remove didOpen, didClose
fix lint & testsPreview: documentation | landing | table |
@@ -56,6 +52,7 @@ class ContextMenu extends AbstractPureComponent<IContextMenuProps, IContextMenuS | |||
return ( | |||
<div className={Classes.CONTEXT_MENU_POPOVER_TARGET} style={this.state.offset}> | |||
<Popover | |||
{...this.props} |
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 seems like a pretty major change where users could possible pass props to the popover this way, now they can't.
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 is not even exported, so it think we're safe here. users use either a decorator @ContextMenuTarget
or a static method ContextMenu.show()
(which looks like this component but isn't).
/** Lifecycle method invoked when an Overlay has finished transitioning to the closed state. */ | ||
onClosed?: () => void; | ||
|
||
/** Lifecycle method invoked when an Overlay begins to open. */ |
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.
i think it might be clearer to say:
Lifecycle method invoked just before an Overlay begins to open.
Because we're dealing with transitions, "when" is ambiguous so we should say "before" or "after" the transition.
Same with onClosing
@@ -134,31 +134,11 @@ export interface IPopoverProps extends IOverlayableProps, IProps { | |||
*/ | |||
popoverClassName?: string; | |||
|
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 is a major API deprecation. What is the upgrade path for existing code?
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.
Note: this interface inherits the new lifecycle interface, so this will just be a rename.
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.
improve lifecycle prop docsPreview: documentation | landing | table |
add node to select usagesPreview: documentation | landing | table |
@themadcreator can you review my recent commits? made some changes worth looking at. |
Fixes #2402
Changes proposed in this pull request:
IOverlayLifecycleProps
definesonOpening
,onOpened
,onClosing
,onClosed
onOpening
andonClosed
the content was not in the DOM (before entering or after exiting, respectively)Overlay
didOpen
,didClose
props with those abovePopover
popoverDid/Will*
props with those aboveReviewers should focus on:
could this be an issue? @invliD thoughts?