Skip to content

Calendar Keyboard Navigation Not Working when selected date (v-model) is out of min/max range #5057

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments

@sundus-y
Copy link
Contributor

sundus-y commented Apr 1, 2020

Describe the bug

On the Calendar, keyboard navigation becomes impossible if the current value is outside the min/max value.

Steps to reproduce the bug

Scenario: When min value is set

  1. Given I have a Calendar component with min value.
  2. And the current value is set to a value less than the min value.
  3. When I try to change the date using the keyboard navigations arrow.
  4. Then the date picker doesn't change and it doesn't do anything.

Scenario: When max value is set

  1. Given I have a Calendar component with max value.
  2. And the current value is set to a value greater than the max value.
  3. When I try to change the date using the keyboard navigations arrow.
  4. Then the date picker doesn't change and it doesn't do anything.

Expected behavior

Scenario: When min value is set

  1. Given I have a Calendar component with min value.
  2. And the current value is set to a value less than the min value.
  3. When I press the up or left arrow key.
  4. The date picker shouldn't change.
  5. When I press the down or right arrow key.
  6. The date picker should go to the min value.

Scenario: When max value is set

  1. Given I have a Calendar component with max value.
  2. And the current value is set to a value greater than the max value.
  3. When I press the down or right arrow key.
  4. The date picker shouldn't change.
  5. When I press the up or left arrow key.
  6. The date picker should go to the min value.

Versions

Libraries:

  • BootstrapVue: 2.9.0
  • Bootstrap: 4.3.x
  • Vue: 2.6.x

Environment:

  • Device: Mac
  • OS: macOS High Sierra
  • Browser: Chrome
  • Version: 80.0.3987.149

Demo link

CodePen Demo Link

Additional context

NA

@tmorehouse
Copy link
Member

Hmmm... we may have to add a few additional handlers to deal when the current month has all dates disabled.

Navigation into previous/next months/dates that are disabled is prevented (as the date "buttons" cannot be focused/selected)

One can tab back (Shift+Tab) into the month navigation controls to move to an active month.

@tmorehouse tmorehouse changed the title Calendar Keyboard Navigation Not Working Calendar Keyboard Navigation Not Working when selected date (v-model) is out of min/max range Apr 1, 2020
@tmorehouse tmorehouse self-assigned this Apr 1, 2020
tmorehouse added a commit that referenced this issue Apr 6, 2020
tmorehouse added a commit that referenced this issue Apr 6, 2020
@tmorehouse tmorehouse added the Status: Fixed / Implemented Issue fixed by a new release label May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment