seb-oss / green

Green is an open-source design system built by SEB.
https://storybook.seb.io/
Apache License 2.0
31 stars 43 forks source link

DatePicker: Incorrect value displayed #1233

Closed gabrieledaugenaite closed 4 months ago

gabrieledaugenaite commented 4 months ago

Bug already reported?

For which framework/library you are reporting the bug

No response

Component name

datepicker

Description

There seems to be some weird behavior after selecting date and opening date picker again to move to next/previous month (without selecting date from that month). The value below date picker and styling in calendar changes to a new one, but the input still displays an old one. You can see the behavior in the screenshots below.

Selecting value first time

image

Opening date picker again and moving to previous month without selecting any date from that month

image

You can see that the date represented in date picker input does not have "selected" date styling

image

So the issue here could be that incorrect date is displayed in input OR that the value is overwritten if viewing another month after making a date selection.

Also another issue (?) - if I remember correctly, previously closing the calendar meant that the date from that month will be selected as new value. Now date picker value is only updated after actually making a selection (except the behavior in the screenshots above). Therefore it is not possible to trigger min/max errors anymore, unless by repeating steps above

Steps To Reproduce

In storybook

  1. Select any date in the date picker
  2. Open the date picker again and using arrows move a month forward/backward
  3. Date from that month will now be the actual date picker value, however the input still displays old value

Current Behaviour

No response

Expected Behaviour

No response

gabrieledaugenaite commented 4 months ago

I just tried the date picker with previous green-angular version

"@sebgroup/green-angular": "~3.1.0",
"@sebgroup/chlorophyll": "~3.0.5",
"@sebgroup/green-core": "~1.5.1",

and see that the behavior existed before, however closing calendar without selecting value from calendar would make auto selection from that month, which is no longer a case in the newest version.

image

image