Skip to content

Commit

Permalink
fix(b-calendar, b-form-datepicker): handle keyboard navigation when s…
Browse files Browse the repository at this point in the history
…elected date is out of range (fixes #5057) (#5108)
  • Loading branch information
tmorehouse committed Apr 6, 2020
1 parent ed6704d commit 6ed09f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/calendar/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -600,18 +600,22 @@ export const BCalendar = Vue.extend({
} else if (keyCode === LEFT) {
// LEFT - Previous day (or next day for RTL)
activeDate.setDate(day + (isRTL ? 1 : -1))
activeDate = this.constrainDate(activeDate)
checkDate = activeDate
} else if (keyCode === RIGHT) {
// RIGHT - Next day (or previous day for RTL)
activeDate.setDate(day + (isRTL ? -1 : 1))
activeDate = this.constrainDate(activeDate)
checkDate = activeDate
} else if (keyCode === UP) {
// UP - Previous week
activeDate.setDate(day - 7)
activeDate = this.constrainDate(activeDate)
checkDate = activeDate
} else if (keyCode === DOWN) {
// DOWN - Next week
activeDate.setDate(day + 7)
activeDate = this.constrainDate(activeDate)
checkDate = activeDate
} else if (keyCode === HOME) {
// HOME - Today
Expand Down

0 comments on commit 6ed09f4

Please sign in to comment.