diff --git a/common/app/routes/challenges/components/map/Map.jsx b/common/app/routes/challenges/components/map/Map.jsx index fedaafb4f6..8571adfa5d 100644 --- a/common/app/routes/challenges/components/map/Map.jsx +++ b/common/app/routes/challenges/components/map/Map.jsx @@ -1,7 +1,7 @@ import React, { PropTypes } from 'react'; import classnames from 'classnames'; import PureComponent from 'react-pure-render/component'; -import { Input, Button, Row } from 'react-bootstrap'; +import { InputGroup, FormControl, Button, Row } from 'react-bootstrap'; import SuperBlock from './Super-Block.jsx'; import FullStack from './Full-Stack.jsx'; @@ -9,7 +9,12 @@ import CodingPrep from './Coding-Prep.jsx'; const clearIcon = ; const searchIcon = ; +const ESC = 27; export default class ShowMap extends PureComponent { + constructor(...props) { + super(...props); + this.handleKeyDown = this.handleKeyDown.bind(this); + } static displayName = 'Map'; static propTypes = { clearFilter: PropTypes.func, @@ -18,6 +23,12 @@ export default class ShowMap extends PureComponent { updateFilter: PropTypes.func }; + handleKeyDown(e) { + if (e.keyCode === ESC) { + this.props.clearFilter(); + } + } + renderSuperBlocks(superBlocks, updateCurrentChallenge) { if (!Array.isArray(superBlocks) || !superBlocks.length) { return