Last active
November 3, 2015 13:56
-
-
Save bingeboy/e88cb7d1a39ec5841945 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Handler for keyDown | |
* @description if ESC key is clicked close modal | |
* @param {object} e - SyntheticKeyboardEvent | |
* @return {undefined} undefined | |
*/ | |
_handleKeyDown: function (e) { | |
if (e.keyCode === 27) { | |
this._handleModalClose(); | |
} | |
}, | |
... | |
/** | |
* Render | |
* @returns {ReactElement} react element | |
*/ | |
render: function () { | |
return ( | |
<div className="site-header" onKeyDown={this._handleKeyDown}> | |
<header role='banner'> | |
{this.props.children} | |
</header> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment