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

The modal's overlay allows closing without an event #34

Open
jcalfee opened this issue Sep 24, 2015 · 0 comments
Open

The modal's overlay allows closing without an event #34

jcalfee opened this issue Sep 24, 2015 · 0 comments

Comments

@jcalfee
Copy link

jcalfee commented Sep 24, 2015

Their is no way to detect when a user clicks away from the model (on the background) triggering it to close. The event happens here when it calls this.setState({open: false}):

https://github.com/akiran/react-foundation-apps/blob/master/src/modal/index.jsx#L35

  hideOverlay: function (e) {
    e.preventDefault();
    if (this.props.overlayClose) {
      this.setState({open: false});   
    }
  },

In our case, we can't use componentWillUnmount, we are using a global model that remains mounted the entire life of the app. When subscribed to the model ZfApi.subscribe(this.props.modalId, (name, msg) => { it would be ideal to see a "close" event issued for the overlayClose in addition to the X and Cancel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant