Describe the bug
When making use of the autoFocus attribute in order to force focus to a form input, an error is thrown, however the feature still seems to work.
The error thrown is: Cannot read properties of undefined (reading 'onFocus'), and it seems to come from line 362 in FormController.js
To Reproduce
This sandbox will initially just contain a Toggle button. Click on that button and the form will be rendered, which is when the autoFocus attribute will take effect. We can see that the input is actually focused as we want it to, however there is a big error that is also thrown
Describe the bug When making use of the autoFocus attribute in order to force focus to a form input, an error is thrown, however the feature still seems to work.
The error thrown is: Cannot read properties of undefined (reading 'onFocus'), and it seems to come from line 362 in FormController.js
To Reproduce
This sandbox will initially just contain a Toggle button. Click on that button and the form will be rendered, which is when the autoFocus attribute will take effect. We can see that the input is actually focused as we want it to, however there is a big error that is also thrown
https://codesandbox.io/s/informed-js-autofocus-bug-1lxwt