freshworks/crayons

[Bug] - Date picker - minYear/maxYear restriction is not working as expected. User is able to navigate outside of the year range using arrow keys.

srivalli-sivaramasankaran opened this issue · 0 comments

Component

fw-datepicker

Describe the bug

minYear/maxYear restriction is not working as expected. User is able to navigate to the year that falls outside of the given maxYear/minYear range using the arrow keys.

To Reproduce

  1. Add a date picker component with min-year and max-year attributes. eg: min-year="2019" max-year="2022"
  2. Click the year dropdown and verify if the options fall within the specified year range
  3. Click the left and right arrows to move to the year that falls outside of the specified range.

Expected behavior

User should not be able to navigate to the year that falls outside of the specified range via arrow keys.

Screenshots

Dropdown with options (2019-2022) that fall within the specified range
Screenshot 2023-01-17 at 12 13 20 PM

Year 2024 (falls outside of range) via right arrow key
Screenshot 2023-01-17 at 12 18 20 PM

Code Sandbox Link
codesandbox.io