Skip to content

Commit

Permalink
[DateInput] close on tab key press (#3038)
Browse files Browse the repository at this point in the history
  • Loading branch information
cetra3 authored and giladgray committed Oct 25, 2018
1 parent 9145edd commit df5d488
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/datetime/src/dateInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,7 @@ export class DateInput extends AbstractPureComponent<IDateInputProps, IDateInput
if (e.which === Keys.ENTER) {
const nextDate = this.parseDate(this.state.valueString);
this.handleDateChange(nextDate, true, true);
} else if (e.which === Keys.TAB && e.shiftKey) {
// close the popover if focus will move to the previous element on
// the page. tabbing forward should *not* close the popover, because
// focus will be moving into the popover itself.
} else if (e.which === Keys.TAB) {
this.setState({ isOpen: false });
} else if (e.which === Keys.ESCAPE) {
this.setState({ isOpen: false });
Expand Down

1 comment on commit df5d488

@blueprint-bot
Copy link

Choose a reason for hiding this comment

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

[DateInput] close on tab key press (#3038)

Previews: documentation | landing | table

Please sign in to comment.