Merge pull request #1732 from matrix-org/dbkr/fix_addpresspicker_keys
Fix key bindings in address picker dialog
This commit is contained in:
commit
9625180fbe
1 changed files with 6 additions and 0 deletions
|
@ -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 a new issue