react-semantic-ui-datepickers icon indicating copy to clipboard operation
react-semantic-ui-datepickers copied to clipboard

Manually editing the date is not working correctly

Open yb172 opened this issue 3 years ago • 1 comments

🐛 bug report

Description of the problem

When you are trying to edit the date manually it won't always work.

Steps to reproduce

Let's say I want to select today's date, but a year ago. What I will do:

  • Go to examples page: https://react-semantic-ui-datepickers.vercel.app/?path=/story/datepickers--basic-usage
  • Select any date with datepicker (e.g. 2022-03-12)
  • Click again on input to see cursor. Use left arrow to move cursor to the last "2" in "2022"

Expected behavior:

  • I hit "backspace" to erase the last "2" in 2022, then "1" to get "2021". Resulting date is "2021-03-12"

Observed behavior:

  • I hit "backspace" to erase the last "2" in 2022, and the cursor immediately jumps to the end of the line, so when I hit "1" I get "2020-31-21"

yb172 avatar Mar 12 '22 23:03 yb172

Hi, @yb172! 👋🏽

Thanks for reporting this issue. I'm able to reproduce it.

This behaviour usually happens when the state update is async but I don't think that's the case here. I'll try to find time to some investigation later, but if you have insights or interest in fixing it, I appreciate it.

arthurdenner avatar Mar 13 '22 08:03 arthurdenner