You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you go to a TimePicker and enter a non-int value into one of the number inputs, it will crash and blank our your entire screen and give a console error. It seems like the TimePicker isn't handling non-int numbers very well.
For example, load up a page with the TimePicker on it that has a default value initialized ( such as '13:00' or new Date()) and overwrite the minutes field to 0.0, your page will crash. It also happens if you have a TimePicker with the value initialized to null. For example, enter 1 for the hours, 1.0 for the minutes, and then select AM. It crashes as soon as onChange is triggered.
This is the console error in Chrome:
Uncaught Error: Failed to get hours from date: 09:.0:00.
at getHours (dates.js:25)
at getHoursMinutes (dates.js:33)
at TimeInput.getProcessedValue (TimeInput.js:369)
at TimeInput.onChangeExternal (TimeInput.js:265)
at callCallback (react-dom.development.js:16433)
at commitUpdateEffects (react-dom.development.js:16472)
at commitUpdateQueue (react-dom.development.js:16460)
at commitLifeCycles (react-dom.development.js:17364)
at commitAllLifeCycles (react-dom.development.js:18736)
at HTMLUnknownElement.callCallback (react-dom.development.js:149)
at Object.invokeGuardedCallbackDev (react-dom.development.js:199)
at invokeGuardedCallback (react-dom.development.js:256)
at commitRoot (react-dom.development.js:18948)
at react-dom.development.js:20418
at Object.unstable_runWithPriority (scheduler.development.js:255)
at completeRoot (react-dom.development.js:20417)
at performWorkOnRoot (react-dom.development.js:20346)
at performWork (react-dom.development.js:20254)
at flushInteractiveUpdates$1 (react-dom.development.js:20503)
at batchedUpdates (react-dom.development.js:2163)
at dispatchEvent (react-dom.development.js:4905)
at react-dom.development.js:20490
at Object.unstable_runWithPriority (scheduler.development.js:255)
at interactiveUpdates$1 (react-dom.development.js:20489)
at interactiveUpdates (react-dom.development.js:2170)
at dispatchInteractiveEvent (react-dom.development.js:4882)
getHours @ dates.js:25
getHoursMinutes @ dates.js:33
getProcessedValue @ TimeInput.js:369
(anonymous) @ TimeInput.js:265
callCallback @ react-dom.development.js:16433
commitUpdateEffects @ react-dom.development.js:16472
commitUpdateQueue @ react-dom.development.js:16460
commitLifeCycles @ react-dom.development.js:17364
commitAllLifeCycles @ react-dom.development.js:18736
callCallback @ react-dom.development.js:149
invokeGuardedCallbackDev @ react-dom.development.js:199
invokeGuardedCallback @ react-dom.development.js:256
commitRoot @ react-dom.development.js:18948
(anonymous) @ react-dom.development.js:20418
unstable_runWithPriority @ scheduler.development.js:255
completeRoot @ react-dom.development.js:20417
performWorkOnRoot @ react-dom.development.js:20346
performWork @ react-dom.development.js:20254
flushInteractiveUpdates$1 @ react-dom.development.js:20503
batchedUpdates @ react-dom.development.js:2163
dispatchEvent @ react-dom.development.js:4905
(anonymous) @ react-dom.development.js:20490
unstable_runWithPriority @ scheduler.development.js:255
interactiveUpdates$1 @ react-dom.development.js:20489
interactiveUpdates @ react-dom.development.js:2170
dispatchInteractiveEvent @ react-dom.development.js:4882
This is the console error in Firefox:
Error: "Failed to get hours from date: 09:.0:00."
getHours dates.js:25
getHoursMinutes dates.js:33
value TimeInput.js:369
t TimeInput.js:265
React 5
unstable_runWithPriority scheduler.production.min.js:18
React 7
unstable_runWithPriority scheduler.production.min.js:18
React 2
react-dom.production.min.js:198:186
React 7
unstable_runWithPriority scheduler.production.min.js:18
React 7
unstable_runWithPriority scheduler.production.min.js:18
React 2
Error: Failed to get hours from date: 09:.0:00. dates.js:25
getHours dates.js:25
getHoursMinutes dates.js:33
value TimeInput.js:369
t TimeInput.js:265
React 5
unstable_runWithPriority scheduler.production.min.js:18
React 7
unstable_runWithPriority scheduler.production.min.js:18
React 2
Pn self-hosted:1029
The text was updated successfully, but these errors were encountered:
emilyuhde
changed the title
Entering non-int number values into inputs crashes
Entering non-int number values into inputs crashes the page
Jun 27, 2019
I've been looking at this issue some more to see if there's some way I can try to fix it on my end as a user of the component, and it doesn't look good so far. It's up to you as the maintainer @wojtekmaj but personally I'd say this is bad enough to warrant a hotfix and release.
If you go to a TimePicker and enter a non-int value into one of the number inputs, it will crash and blank our your entire screen and give a console error. It seems like the TimePicker isn't handling non-int numbers very well.
For example, load up a page with the TimePicker on it that has a default value initialized ( such as '13:00' or
new Date()
) and overwrite the minutes field to 0.0, your page will crash. It also happens if you have a TimePicker with the value initialized to null. For example, enter 1 for the hours, 1.0 for the minutes, and then select AM. It crashes as soon as onChange is triggered.This is the console error in Chrome:
This is the console error in Firefox:
The text was updated successfully, but these errors were encountered: