Skip to content

Commit

Permalink
Layer: esc to dismiss layer
Browse files Browse the repository at this point in the history
  • Loading branch information
alansouzati committed Oct 13, 2016
1 parent e2d9562 commit 6439dbd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/js/components/Layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,14 @@ class LayerContents extends Component {
this._keyboardHandlers = {
tab: this._processTab
};
KeyboardAccelerators.startListeningToKeyboard(
this, this._keyboardHandlers
);

if (this.props.onClose) {
const layerParent = this.containerRef.parentNode;
this._keyboardHandlers.esc = onClose;
layerParent.addEventListener('click', this._onClick.bind(this));
}
KeyboardAccelerators.startListeningToKeyboard(
this, this._keyboardHandlers
);
}

componentDidUpdate () {
Expand Down

0 comments on commit 6439dbd

Please sign in to comment.