-
-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
focus/change/blur is not a function #472
Comments
Just to confirm, the error vanished after rolling back final-form only, to 4.20.7. Would still like to get to the bottom of this, as staying with 4.20.7 forever is not our preferred way to go :/ |
33e551f solved a big bug in arrays so I would like to build on those changes instead of rolling back. Is it possible to provide a CodeSandbox of some sort of mock-up that we can debug more effectively? I think we may have some success by just conditionally executing those methods. |
Excuse the delay - I wanted to provide a CodeSandbox (failed try: https://codesandbox.io/s/nifty-morning-fwf5sb?file=/src/App.tsx) to not just prevent the error but allow for the best behavior possible. Also asked fellow devs with code insight for creative ideas without success. I have no idea how our end users achieve this :/ Absolutely agree with keeping and improving the fix - we only had to roll back on our side. I think I have to give up regarding the reproduction :/ Conditionally executing the functions should at least prevent the error. I'm just not sure what the behavior will then be. If I can assist in that regard, please let me know. Am willing to provide a PR as well, just don't know the project internals too well so far. |
I attempted to trigger the error with your Sandbox. Here is a forked version: https://codesandbox.io/s/nervous-grass-dsy7k0?file=/src/App.tsx I thought it may happen when you call focus or change on a field that is not currently rendered, but that does not seem to be the case... Other possible causes that I can think of:
|
minor update for anyone wondering: One change since then was that we replaced a very busy section of our form that indeed was array-based. Our replacement is more distant from final-form and just interacts via form.changes. So far, we can only suppose that it was the culprit and don't know exactly how we worked around it. Will still try to reproduce/provoke the issue with some final-form-arrays-insights Gert provided me with - but this might as well be it for this issue :/ |
Are you submitting a bug report or a feature request?
bug report
What is the current behavior?
We get live bugsnag reports about focus/change/blur not being a function since our latest release:
TypeError P.blur is not a function
TypeError P.change is not a function
TypeError P.focus is not a function
Sadly, I don't know how our prod users achieve the error.
Looking into the prod source, the same places' breakpoints trigger on blur/change/focusing a react-final-form input.
Main change suspected that started to cause this:
Going through the changeset from 4.20.7 to 4.20.8, 33e551f caught my eye. It changed the blur/change/focus function handling and may not work in all cases.
What is the expected behavior?
Focus/Change/Blur should be a function if existing, and only be called if it's a function.
Sandbox Link
Sadly none.
What's your environment?
Browser: Current Chrome.
Our project is huge, but related to this project should be these dependencies:
Other information
Sorry for not providing more info outright, I'll try to provide what I can when asked.
The text was updated successfully, but these errors were encountered: