Skip to content

Commit

Permalink
feat: close picker
Browse files Browse the repository at this point in the history
  • Loading branch information
myronliu347 committed Jun 9, 2018
1 parent 096bc73 commit 81b5f8f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ui/DateInput/DateInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { DatePicker, TimePicker, DateTimePicker } from '../Picker';
import Container from './Container';
import dayjs from 'dayjs';
import Button from '../Button/Button';
import keycode from 'keycode';

const DEFAULT_FORMAT = {
date: 'YYYY-MM-DD',
Expand Down Expand Up @@ -197,9 +198,12 @@ export default {
},
on: {
...listeners,
click: (e) => {
focus: (e) => {
this.open = true;
this.$emit('click', e);
},
keydown: (e) => {
if (keycode(e) === 'tab') this.closePicker();
this.$emit('keydown', e);
}
}
},
Expand Down

0 comments on commit 81b5f8f

Please sign in to comment.