mirror of https://github.com/vector-im/riot-web
Fix key bindings in address picker dialog
Another regression from https://github.com/matrix-org/matrix-react-sdk/pull/1674 Fixes https://github.com/vector-im/riot-web/issues/5994pull/21833/head
parent
127eb61d36
commit
6162c0b360
|
@ -37,6 +37,9 @@ export default React.createClass({
|
||||||
// callback to call when Enter is pressed
|
// callback to call when Enter is pressed
|
||||||
onEnterPressed: PropTypes.func,
|
onEnterPressed: PropTypes.func,
|
||||||
|
|
||||||
|
// called when a key is pressed
|
||||||
|
onKeyDown: PropTypes.func,
|
||||||
|
|
||||||
// CSS class to apply to dialog div
|
// CSS class to apply to dialog div
|
||||||
className: PropTypes.string,
|
className: PropTypes.string,
|
||||||
|
|
||||||
|
@ -49,6 +52,9 @@ export default React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
_onKeyDown: function(e) {
|
_onKeyDown: function(e) {
|
||||||
|
if (this.props.onKeyDown) {
|
||||||
|
this.props.onKeyDown(e);
|
||||||
|
}
|
||||||
if (e.keyCode === KeyCode.ESCAPE) {
|
if (e.keyCode === KeyCode.ESCAPE) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
Loading…
Reference in New Issue