Giter Club home page Giter Club logo

Comments (5)

FC-jan avatar FC-jan commented on May 26, 2024

Just to confirm, the error vanished after rolling back final-form only, to 4.20.7.
This would further support the theory that the cause probably is 33e551f.

Would still like to get to the bottom of this, as staying with 4.20.7 forever is not our preferred way to go :/

from final-form.

gertdreyer avatar gertdreyer commented on May 26, 2024

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.

from final-form.

FC-jan avatar FC-jan commented on May 26, 2024

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.
Also, I'm wondering where that condition should be placed, as the calls might be anywhere from my understanding. I think it should be wrapped close to the field, so the outside can blindly call blur/change/focus without regard.

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.

from final-form.

gertdreyer avatar gertdreyer commented on May 26, 2024

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:

  • The source error is located in either final-form-arrays, react-final-form-arrays, or calculate.
  • New behaviour of arrays - empty arrays return to undefined to match the normal fields, the previous behaviour can be achieved with an identity function passed to the parse callback. But that seems to be fine from my tests....

from final-form.

FC-jan avatar FC-jan commented on May 26, 2024

minor update for anyone wondering:
Gert and me had a quick hangout to demo my use case, it's difficult to transfer to a sandbox. To make the most of it, I prepared a re-release with the versions affected - and didn't get the error anymore. 🤯

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 :/

from final-form.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.