-
Notifications
You must be signed in to change notification settings - Fork 14k
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
fixed modal close issue #5865
fixed modal close issue #5865
Conversation
@@ -82,31 +82,31 @@ export default class ModalTrigger extends React.Component { | |||
'btn btn-default btn-sm': this.props.isButton, | |||
}); | |||
if (this.props.isButton) { | |||
return ( | |||
return [ |
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.
do you think we should use React.Fragment
s here? I'm not sure of the advantages of them vs arrays (maybe <>...</>
syntax is supported with our build config?)
Did you check the usage as a MenuItem
? I was wondering if the parent of a MenuItem
(prob a <ul />
) would care if it had a modal / non-MenuItem
(prob an <li />
) child . This might not be a problem if the modal renders into a portal (not the parent dom container) since it wouldn't create an invalid DOM structure.
EDIT: you prob did check the latter point if you were testing the "view query" modal 👍
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.
framents vs arrays described here. Not sure it matters too much.
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.
@williaster Thanks! was reading the article before. and Indeed In think in this case, <Fragment />
makes more sense.
Children in an array must have a key to prevent React’s key warning.
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.
@williaster and yes, I checked the MenuItem
:)
Related to React16 upgrade? |
yeah I think so |
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.
LGTM when the build passes / after rebase.
77ec029
to
2dd4c69
Compare
* fixed modal close issue * change Children array to Fragment (cherry picked from commit 10836ce)
* fixed modal close issue * change Children array to Fragment (cherry picked from commit 10836ce)
* fixed modal close issue * change Children array to Fragment (cherry picked from commit 10836ce)
* fixed modal close issue * change Children array to Fragment (cherry picked from commit 10836ce)
* fixed modal close issue * change Children array to Fragment (cherry picked from commit 10836ce)
@conglei does this PR solves the issue where you can't write in textfield or use select2 and some checkboxes inside modal |
* fixed modal close issue * change Children array to Fragment (cherry picked from commit 10836ce)
* fixed modal close issue * change Children array to Fragment
* fixed modal close issue * change Children array to Fragment (cherry picked from commit 10836ce)
* fixed modal close issue * change Children array to Fragment (cherry picked from commit 10836ce)
* fixed modal close issue * change Children array to Fragment (cherry picked from commit 10836ce)
* fixed modal close issue * change Children array to Fragment (cherry picked from commit 10836ce)
* fixed modal close issue * change Children array to Fragment (cherry picked from commit 10836ce)
* fixed modal close issue * change Children array to Fragment (cherry picked from commit 10836ce)
* fixed modal close issue * change Children array to Fragment (cherry picked from commit 10836ce)
* fixed modal close issue * change Children array to Fragment (cherry picked from commit 10836ce)
* fixed modal close issue * change Children array to Fragment (cherry picked from commit 10836ce)
* fixed modal close issue * change Children array to Fragment (cherry picked from commit 10836ce)
* fixed modal close issue * change Children array to Fragment (cherry picked from commit 10836ce)
* fixed modal close issue * change Children array to Fragment (cherry picked from commit 10836ce)
* fixed modal close issue * change Children array to Fragment (cherry picked from commit 10836ce)
* fixed modal close issue * change Children array to Fragment (cherry picked from commit 10836ce)
This PR is to fix the issue that the modal generated by
ModelTrigger
cannot be closed properly.Credit to @williaster for finding the bug!
The root cause is
this.open
will be trigger since the modal literally is inside the parent dom which hasthis.open
binded withonClick
.