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
Setting autofocus: true to InputMaks causes app crash. It tries to access elementRef.current.value in onFocus method, but elementRef.current is null at the moment.
inputmask.esm.js:353
Uncaught TypeError: Cannot read properties of null (reading 'value')
at onFocus (inputmask.esm.js:353:1)
at HTMLUnknownElement.callCallback (react-dom.development.js:3945:1)
at Object.invokeGuardedCallbackDev (react-dom.development.js:3994:1)
at invokeGuardedCallback (react-dom.development.js:4056:1)
at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4070:1)
at executeDispatch (react-dom.development.js:8243:1)
at processDispatchQueueItemsInOrder (react-dom.development.js:8275:1)
at processDispatchQueue (react-dom.development.js:8288:1)
at dispatchEventsForPlugins (react-dom.development.js:8299:1)
at react-dom.development.js:8508:1
at batchedEventUpdates$1 (react-dom.development.js:22396:1)
at batchedEventUpdates (react-dom.development.js:3745:1)
at dispatchEventForPluginEventSystem (react-dom.development.js:8507:1)
at attemptToDispatchEvent (react-dom.development.js:6005:1)
at dispatchEvent (react-dom.development.js:5924:1)
at unstable_runWithPriority (scheduler.development.js:468:1)
at runWithPriority$1 (react-dom.development.js:11276:1)
at discreteUpdates$1 (react-dom.development.js:22413:1)
at discreteUpdates (react-dom.development.js:3756:1)
at dispatchDiscreteEvent (react-dom.development.js:5889:1)
at commitMount (react-dom.development.js:10244:1)
at commitLifeCycles (react-dom.development.js:20752:1)
at commitLayoutEffects (react-dom.development.js:23426:1)
at HTMLUnknownElement.callCallback (react-dom.development.js:3945:1)
at Object.invokeGuardedCallbackDev (react-dom.development.js:3994:1)
at invokeGuardedCallback (react-dom.development.js:4056:1)
at commitRootImpl (react-dom.development.js:23151:1)
at unstable_runWithPriority (scheduler.development.js:468:1)
at runWithPriority$1 (react-dom.development.js:11276:1)
at commitRoot (react-dom.development.js:22990:1)
at performSyncWorkOnRoot (react-dom.development.js:22329:1)
at react-dom.development.js:11327:1
at unstable_runWithPriority (scheduler.development.js:468:1)
at runWithPriority$1 (react-dom.development.js:11276:1)
at flushSyncCallbackQueueImpl (react-dom.development.js:11322:1)
at flushSyncCallbackQueue (react-dom.development.js:11309:1)
at scheduleUpdateOnFiber (react-dom.development.js:21893:1)
at Object.enqueueSetState (react-dom.development.js:12467:1)
at push../node_modules/react/cjs/react.development.js.Component.setState (react.development.js:365:1)
at Router.js:34:1
at listener (history.js:155:1)
at history.js:173:1
at Array.forEach (<anonymous>)
at Object.notifyListeners (history.js:172:1)
at setState (history.js:288:1)
at history.js:369:1
at Object.confirmTransitionTo (history.js:145:1)
at Object.push (history.js:350:1)
at Object.onSuccess (VerifyPhoneNumber.tsx:111:1)
at useMutation.js:143:1
Reproducer
No response
PrimeReact version
9.6.1
React version
17.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
I couldn't reproduce in isolated env.
Expected behavior
It doesn't try to reach onFocus before input reference is set, or at least doesn't crash b/c there is no ref.
The text was updated successfully, but these errors were encountered:
melloware
changed the title
Autofocus crashes InputMask
InputMask: Autofocus crashes
Sep 6, 2023
melloware
added
Type: Bug
Issue contains a defect related to a specific component.
and removed
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
labels
Sep 6, 2023
melloware
added a commit
to melloware/primereact
that referenced
this issue
Sep 6, 2023
Describe the bug
Setting
autofocus: true
toInputMaks
causes app crash. It tries to accesselementRef.current.value
inonFocus
method, butelementRef.current
isnull
at the moment.Reproducer
No response
PrimeReact version
9.6.1
React version
17.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
I couldn't reproduce in isolated env.
Expected behavior
It doesn't try to reach
onFocus
before input reference is set, or at least doesn't crash b/c there is no ref.The text was updated successfully, but these errors were encountered: