akiran / akiran/react-foundation-apps

The modal's overlay allows closing without an event

Ouverte
#34 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
JavaScript
Étoiles
291
Forks
45
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

``` javascript
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`.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.