wojtekmaj/react-time-picker

OnChange does not correctly capture invalid minutes value when re entered

Closed this issue · 4 comments

STR:

  1. enter a time with invalid minutes say '08:88 AM' everything is fine as onChange does not trigger when it is invalid in this case
  2. however click on minutes section and enter '77' all of a sudden onChange triggers and now the time says it's '08:07' a valid time, but not what the user entered. This causes a seemingly invalid time, to pass validation

Please see attached, me entering a valid time, then re entering an invalid time and having it show up as just the first digit. e.g. '08:77" becomes '08:07'

time-picker-onChange-issue.mov

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days.

This issue was closed because it has been stalled for 14 days with no activity.

Before an invalid value "77" was entered, a perfectly valid "7" must have been entered first. As the last valid value, 8:07 gets accepted here.

Hello @wojtekmaj
Thank you for this great lib. However, looks like this is a bug. We need to have the ability to override invalid values, for example, if the user enters 66 minutes, the system should be able to override to 06, as it implemented in input type="time".
At this moment we just have difference between what we have in state and what we display.