mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-19 05:21:22 +02:00
fix keyboard shortcuts on logout prompt
This commit is contained in:
parent
0d153df417
commit
dfbc88d421
@ -31,14 +31,22 @@ module.exports = React.createClass({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onKeyDown: function(e) {
|
||||||
|
if (e.keyCode === 27) { // escape
|
||||||
|
e.stopPropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
this.cancelPrompt();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className="mx_Dialog_content">
|
<div className="mx_Dialog_content">
|
||||||
Sign out?
|
Sign out?
|
||||||
</div>
|
</div>
|
||||||
<div className="mx_Dialog_buttons">
|
<div className="mx_Dialog_buttons" onKeyDown={ this.onKeyDown } >
|
||||||
<button onClick={this.logOut}>Sign Out</button>
|
<button autoFocus onClick={this.logOut}>Sign Out</button>
|
||||||
<button onClick={this.cancelPrompt}>Cancel</button>
|
<button onClick={this.cancelPrompt}>Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user