axa-ch-webhub-cloud / pattern-library

AXA CH UI component library. Please share, comment, create issues and work with us!
https://axa-ch-webhub-cloud.github.io/plib-feature/develop
126 stars 18 forks source link

Year dropdown in Datepicker is not sorted correctly #2361

Closed ErikJermanis closed 1 year ago

ErikJermanis commented 1 year ago

Expected Behavior

Options in year dropdown should be sorted in ascending or descending order consistently

Current Behavior

When I open Datepicker for the first time, options in year dropdown are sorted in ascending order. However, when I close the Datepicker, and open it for the second time, options in year dropdown are sorted in descending order.

Steps to Reproduce

  1. Create a Datepicker in React
  2. Open the Datepicker by clicking on calendar icon
  3. Close the Datepicker and reopen it again. <AXADatepickerReact inputfield allowedyears={[${new Date(1970, 0, 1).getFullYear()}-${new Date().getFullYear()}]} placeholder="DD.MM.YYYY" />

Context (Environment)

I want to use this component in Baugarantie 2.0 app. I use macOS Monterey Version 12.3, Brave browser, React 18.1.0, and @axa-ch/datepicker version 17.0.4

Possible Solution

Make sorting of options in year dropdown consistent.

MKaHead commented 1 year ago

Hi @ErikJermanis, thanks for the issue, we will have a look soon.

MKaHead commented 1 year ago

Hello @ErikJermanis, I can't reproduce the issue even with the version. See here Stackblitz

Maybe I can help you bilaterally, you can reach me typical axa channels Slack, Teams and mail (marco.kruse@axa.ch).

MKaHead commented 1 year ago

Since the problem is not reproducible and no further work has been done, I am closing the issue. Feel free to open it if the problem persists.