Skip to content

Commit

Permalink
Handle focus when tabbing out of flatpickr (flatpickr#1441)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewlouie authored and chmln committed Jul 20, 2018
1 parent 7e66ed0 commit a823f13
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,10 @@ function FlatpickrInstance(
break;

case 9:
if (!isTimeObj) break;
if (!isTimeObj) {
self.element.focus();
break;
}
const elems = [
self.hourElement,
self.minuteElement,
Expand All @@ -1567,6 +1570,8 @@ function FlatpickrInstance(
if (target !== undefined) {
e.preventDefault();
target.focus();
} else {
self.element.focus();
}
}

Expand Down

0 comments on commit a823f13

Please sign in to comment.