From 6162c0b3605c284fe053e9de94adbae8daaec6ca Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 6 Feb 2018 15:01:14 +0000 Subject: [PATCH] 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/5994 --- src/components/views/dialogs/BaseDialog.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/views/dialogs/BaseDialog.js b/src/components/views/dialogs/BaseDialog.js index 8e6f944df3..e879808dc2 100644 --- a/src/components/views/dialogs/BaseDialog.js +++ b/src/components/views/dialogs/BaseDialog.js @@ -37,6 +37,9 @@ export default React.createClass({ // callback to call when Enter is pressed onEnterPressed: PropTypes.func, + // called when a key is pressed + onKeyDown: PropTypes.func, + // CSS class to apply to dialog div className: PropTypes.string, @@ -49,6 +52,9 @@ export default React.createClass({ }, _onKeyDown: function(e) { + if (this.props.onKeyDown) { + this.props.onKeyDown(e); + } if (e.keyCode === KeyCode.ESCAPE) { e.stopPropagation(); e.preventDefault();