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
When I type four numbers everything goes well - onChange invokes, code changes.
But when I press any keyboard key in the last input field once more I always got the following error
(it happens also if you start to type from the last field and just press key twice)
Uncaught TypeError: Cannot assign to read only property 'display' of object '#<Object>'
at Function.assign (<anonymous>)
at t.value (ReactCodeInput.js:271)
Also this error occurs even on 1st key press if I change onChange to
const onChange = (code) => null
SOLUTION
this prop
style={{ width: 212 }}
caused the above error
I removed it and everything worked fine
Hopefully the author fix it
Best regards..
The text was updated successfully, but these errors were encountered:
mvarakin
changed the title
onChange fails on key pressing fields+1 character
Component fails on second key pressing in the last input field
Feb 18, 2021
mvarakin
changed the title
Component fails on second key pressing in the last input field
SOLVED: Component fails on second key pressing in the last input field
Feb 18, 2021
Hi there,
[For solution please see below]
here is part of my code
...
const [code, setCode] = useState('');
const onChange = (code) => {
setCode(code)
}
...
It renders 4 fields as supposed to.
When I type four numbers everything goes well - onChange invokes, code changes.
But when I press any keyboard key in the last input field once more I always got the following error
(it happens also if you start to type from the last field and just press key twice)
Also this error occurs even on 1st key press if I change onChange to
const onChange = (code) => null
SOLUTION
this prop
style={{ width: 212 }}
caused the above error
I removed it and everything worked fine
Hopefully the author fix it
Best regards..
The text was updated successfully, but these errors were encountered: