Merge pull request #841 from matrix-org/luke/fix-double-dialogs
Fix dialog reappearing after hitting Enterpull/21833/head
commit
1913a32fbd
|
@ -57,7 +57,9 @@ export default React.createClass({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_onKeyDown: function(e) {
|
// Must be when the key is released (and not pressed) otherwise componentWillUnmount
|
||||||
|
// will focus another element which will receive future key events
|
||||||
|
_onKeyUp: function(e) {
|
||||||
if (e.keyCode === KeyCode.ESCAPE) {
|
if (e.keyCode === KeyCode.ESCAPE) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -79,7 +81,7 @@ export default React.createClass({
|
||||||
const TintableSvg = sdk.getComponent("elements.TintableSvg");
|
const TintableSvg = sdk.getComponent("elements.TintableSvg");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div onKeyDown={this._onKeyDown} className={this.props.className}>
|
<div onKeyUp={this._onKeyUp} className={this.props.className}>
|
||||||
<AccessibleButton onClick={this._onCancelClick}
|
<AccessibleButton onClick={this._onCancelClick}
|
||||||
className="mx_Dialog_cancelButton"
|
className="mx_Dialog_cancelButton"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue