mirror of https://github.com/vector-im/riot-web
Merge pull request #1732 from matrix-org/dbkr/fix_addpresspicker_keys
Fix key bindings in address picker dialogpull/21833/head
commit
9625180fbe
|
@ -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