Skip to content

Commit

Permalink
[Select] fixes palantir#2135 - Adds a blur explicitly when escape key…
Browse files Browse the repository at this point in the history
… is pressed.
  • Loading branch information
danielbh committed Mar 7, 2018
1 parent cff13ed commit 6e331ff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/select/src/components/select/multiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ export class MultiSelect<T> extends React.PureComponent<IMultiSelectProps<T>, IM
const { resetOnSelect } = this.props;

if (which === Keys.ESCAPE || which === Keys.TAB) {
// By default the escape key will not trigger a blur on the
// input element. It must be done explicitly.
this.input.blur();
this.setState({
activeItem: resetOnSelect ? this.props.items[0] : this.state.activeItem,
isOpen: false,
Expand Down

1 comment on commit 6e331ff

@danielbh
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Select] fixes palantir#2135 - Adds a blur explicitly when escape key is pressed.

Preview: documentation | landing | table

Please sign in to comment.