akiran / akiran/react-foundation-apps

The modal's overlay allows closing without an event

オープン
#34 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
291
フォーク
45
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。