-
-
Notifications
You must be signed in to change notification settings - Fork 40
move
and swap
break form inputs
#15
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
Comments
Yeah, I believe you've found a bug, indeed. I'll write a test case for it. |
That would be great! I could look into it this weekend. |
Hey guys, any news on this or some lead ? I can't implement a drag&drop sorting sadly due to this bug. |
Sadly, nothing to report yet!
|
If I do this I got the old bug, code it's quite complicated to get into :( |
I had to move my form to https://github.com/jaredpalmer/formik, re-ordering is working but now we are facing performance issues. |
I'm sorry to hear that @tlenclos 😢 |
I wrote tests for |
ok, I upgraded all dependencies in the codesandbox and the behavior is still buggy but slightly different. https://codesandbox.io/s/qkl20opx4w Downgrading final-form-arrays to |
Thank you so much for looking into it Maciej! 🙏 After reading your message I had a glance at the code again and believe I have identified the issue 🙌 I have to admit, I was a little bit reluctant to dive into the code because debugging the issue is so involved. I ended up building the package with Any hints on how to facilitate development? |
During move and swap, the field state of the source field was copied to the target field. The field state, however, contained functions that had a reference to the previous position. This caused changes to be applied to the wrong field. Resolves: final-form#15 See also: final-form#10
@carlhueffmeier thanks! This library lacks integration tests with others from the ecosystem. I'll write such integration tests soon because it's not the first time a similar issue happens. |
Published fix in |
Are you submitting a bug report or a feature request?
I believe I found a bug.
What is the current behavior?
These are the steps to reproduce:
What is the expected behavior?
Swapping or moving fields should preserve behavior.
Sandbox Link
To keep things as simple as possible, I reused the sandbox from the issue referenced below, simply upgrading the library version to 1.1.0.
What's your environment?
The problem occurs with
final-form-arrays
version 1.1.0. Downgrading the package to 1.0.6 solves the problem.Other information
I believe the problem is caused by the latest change to the
move
andswap
code in response to this previous issue.This commit looks especially suspicious.
I would be happy to work on it, if you give me some pointers on where to start 💪
The text was updated successfully, but these errors were encountered: