-
Notifications
You must be signed in to change notification settings - Fork 183
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
Add option destroyOnHide #72
Conversation
src/Dialog.tsx
Outdated
> | ||
{props.children} | ||
let dialogElement; | ||
if (props.visible || !props.destroyOnHide) { |
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.
Sorry for the delayed response. But I think here is the better place to add this conditional statement.
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.
In that case leaving animation won't work because we are using <Animate inside Dialog and if we unmount its parent then leaving animation won't work @yesmeck
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.
Hmm, you are right, how about put it to the below {(props.visible || !props.destroyOnHide) && dialogElement}
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.
make sense will update the pr @yesmeck
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.
Thanks, could you write a test?
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.
sure
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.
@yesmeck done
@Rohanhacker Great work, I renamed |
@Rohanhacker Could you upgrade antd's rc-dialog to 7.1.0 and update the document? |
yup will send a pr |
Adding destroyOnHide to Dialog unmount child components
Addresses #22 && Add [destroyOnHide] to Modal #8494