diff --git a/app/components/base/Dropdown.js b/app/components/base/Dropdown.js index 941557586..39455eb18 100644 --- a/app/components/base/Dropdown.js +++ b/app/components/base/Dropdown.js @@ -36,14 +36,20 @@ class Dropdown extends Component { } componentDidMount () { - ReactDOM.findDOMNode(this).addEventListener('keydown', e => { + this._bodyKeydownHandler = e => { if (this.state.open && e.keyCode === 27) { e.preventDefault(); e.stopPropagation(); // Pressed escape this.hide(); } - }); + }; + + document.body.addEventListener('keydown', this._bodyKeydownHandler); + } + + componentWillUnmount () { + document.body.removeEventListener('keydown', this._bodyKeydownHandler); } render () { @@ -62,8 +68,7 @@ class Dropdown extends Component { return (
Jump To Request
+Quick Switch
No matches found for {searchString} @@ -229,6 +304,7 @@ class RequestSwitcherModal extends Component { RequestSwitcherModal.propTypes = { activateRequest: PropTypes.func.isRequired, + activateWorkspace: PropTypes.func.isRequired, workspaceId: PropTypes.string.isRequired, activeRequestParentId: PropTypes.string.isRequired }; diff --git a/app/containers/App.js b/app/containers/App.js index 8830129cf..afe0de143 100644 --- a/app/containers/App.js +++ b/app/containers/App.js @@ -5,9 +5,7 @@ import {connect} from 'react-redux'; import {bindActionCreators} from 'redux'; import HTML5Backend from 'react-dnd-html5-backend'; import {DragDropContext} from 'react-dnd'; - import Mousetrap from '../lib/mousetrap'; - import {addModal} from '../components/modals'; import WorkspaceEnvironmentsEditModal from '../components/modals/WorkspaceEnvironmentsEditModal'; import CookiesModal from '../components/modals/CookiesModal'; @@ -23,21 +21,21 @@ import ResponsePane from '../components/ResponsePane'; import Sidebar from '../components/sidebar/Sidebar'; import {PREVIEW_MODE_FRIENDLY} from '../lib/previewModes'; import { - MAX_PANE_WIDTH, MIN_PANE_WIDTH, + MAX_PANE_WIDTH, + MIN_PANE_WIDTH, DEFAULT_PANE_WIDTH, MAX_SIDEBAR_REMS, MIN_SIDEBAR_REMS, - DEFAULT_SIDEBAR_WIDTH -} from '../lib/constants' - + DEFAULT_SIDEBAR_WIDTH, + CHECK_FOR_UPDATES_INTERVAL +} from '../lib/constants'; import * as GlobalActions from '../redux/modules/global'; import * as RequestActions from '../redux/modules/requests'; - +import * as WorkspaceActions from '../redux/modules/workspaces'; import * as db from '../database'; import {importCurl} from '../lib/export/curl'; import {trackEvent} from '../lib/analytics'; import {getAppVersion} from '../lib/appInfo'; -import {CHECK_FOR_UPDATES_INTERVAL} from '../lib/constants'; import {getModal} from '../components/modals/index'; @@ -473,7 +471,8 @@ class App extends Component { const gridTemplateColumns = `${sidebarWidth}rem 0 ${paneWidth}fr 0 ${1 - paneWidth}fr`; return ( -