Skip to content
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

Merged
merged 2 commits into from
Sep 13, 2018
Merged

Conversation

conglei
Copy link
Contributor

@conglei conglei commented Sep 12, 2018

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 has this.open binded with onClick.

model_close_bug

@@ -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 [
Copy link
Contributor

@williaster williaster Sep 12, 2018

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.Fragments 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 👍

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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 :)

@mistercrunch
Copy link
Member

Related to React16 upgrade?

@williaster
Copy link
Contributor

yeah I think so

@williaster
Copy link
Contributor

@conglei tried to fix the js test that failed your build in #5874

Copy link
Contributor

@williaster williaster left a 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.

@mistercrunch mistercrunch merged commit 10836ce into apache:master Sep 13, 2018
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* fixed modal close issue

* change Children array to Fragment

(cherry picked from commit 10836ce)
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* fixed modal close issue

* change Children array to Fragment

(cherry picked from commit 10836ce)
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* fixed modal close issue

* change Children array to Fragment

(cherry picked from commit 10836ce)
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* fixed modal close issue

* change Children array to Fragment

(cherry picked from commit 10836ce)
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* fixed modal close issue

* change Children array to Fragment

(cherry picked from commit 10836ce)
@aboganas
Copy link
Contributor

aboganas commented Sep 25, 2018

@conglei does this PR solves the issue where you can't write in textfield or use select2 and some checkboxes inside modal

cant_write_modal

betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 11, 2018
* fixed modal close issue

* change Children array to Fragment

(cherry picked from commit 10836ce)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 12, 2018
* fixed modal close issue

* change Children array to Fragment
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 12, 2018
* fixed modal close issue

* change Children array to Fragment

(cherry picked from commit 10836ce)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 12, 2018
* fixed modal close issue

* change Children array to Fragment

(cherry picked from commit 10836ce)
youngyjd pushed a commit to lyft/incubator-superset that referenced this pull request Oct 17, 2018
* fixed modal close issue

* change Children array to Fragment

(cherry picked from commit 10836ce)
youngyjd pushed a commit to lyft/incubator-superset that referenced this pull request Oct 17, 2018
* fixed modal close issue

* change Children array to Fragment

(cherry picked from commit 10836ce)
youngyjd pushed a commit to lyft/incubator-superset that referenced this pull request Oct 17, 2018
* fixed modal close issue

* change Children array to Fragment

(cherry picked from commit 10836ce)
youngyjd pushed a commit to lyft/incubator-superset that referenced this pull request Oct 17, 2018
* fixed modal close issue

* change Children array to Fragment

(cherry picked from commit 10836ce)
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Oct 29, 2018
* fixed modal close issue

* change Children array to Fragment

(cherry picked from commit 10836ce)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 30, 2018
* fixed modal close issue

* change Children array to Fragment

(cherry picked from commit 10836ce)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 30, 2018
* fixed modal close issue

* change Children array to Fragment

(cherry picked from commit 10836ce)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 30, 2018
* fixed modal close issue

* change Children array to Fragment

(cherry picked from commit 10836ce)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 30, 2018
* fixed modal close issue

* change Children array to Fragment

(cherry picked from commit 10836ce)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 30, 2018
* fixed modal close issue

* change Children array to Fragment

(cherry picked from commit 10836ce)
youngyjd pushed a commit to lyft/incubator-superset that referenced this pull request Nov 2, 2018
* fixed modal close issue

* change Children array to Fragment

(cherry picked from commit 10836ce)
youngyjd pushed a commit to lyft/incubator-superset that referenced this pull request Nov 2, 2018
* fixed modal close issue

* change Children array to Fragment

(cherry picked from commit 10836ce)
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants