summaryrefslogtreecommitdiffstats
path: root/webapp/components/search_bar.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/search_bar.jsx')
-rw-r--r--webapp/components/search_bar.jsx11
1 files changed, 8 insertions, 3 deletions
diff --git a/webapp/components/search_bar.jsx b/webapp/components/search_bar.jsx
index 581fe0536..11ceaac73 100644
--- a/webapp/components/search_bar.jsx
+++ b/webapp/components/search_bar.jsx
@@ -15,7 +15,9 @@ import {getFlaggedPosts, performSearch} from 'actions/post_actions.jsx';
import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
-var ActionTypes = Constants.ActionTypes;
+const ActionTypes = Constants.ActionTypes;
+const KeyCodes = Constants.KeyCodes;
+
import {Tooltip, OverlayTrigger, Popover} from 'react-bootstrap';
import PropTypes from 'prop-types';
@@ -110,8 +112,11 @@ export default class SearchBar extends React.Component {
});
}
- handleKeyDown() {
- // This is just to prevent a JS error
+ handleKeyDown(e) {
+ if (e.which === KeyCodes.ESCAPE) {
+ e.stopPropagation();
+ e.preventDefault();
+ }
}
handleChange(e) {