Skip to content

Conversation

@dekhanov
Copy link
Contributor

Hi, @erikras!

Sorry for directly mentioning you, but I need your help!
I opened issue #19 some time ago, and since there were no activities, I tried to handle it myself.

It turns out that the bug occurs due to moveFieldState function, which expects that objects in the array have the same shape. It's not always true. I wrote a test for this case.

function moveFieldState({ destKey, source }) {
  state.fields[destKey] = {
    ...source,
    name: destKey,
    change: state.fields[destKey].change, // prevent functions from being overwritten
    blur: state.fields[destKey].blur,
    focus: state.fields[destKey].focus,
    lastFieldState: undefined // clearing lastFieldState forces renotification
  }
}

I will be glad to make a fix, but I not sure what to do with these change, blur and focus handlers in case if there is no state.fields[destKey] field.
Could you tell the right way to handle this?

@erikras
Copy link
Member

erikras commented Jul 13, 2019

Great test. Will merge and fix...

@erikras erikras merged commit ced46c6 into final-form:master Jul 13, 2019
@seeden
Copy link

seeden commented Jul 18, 2019

It is not working in 3.0.1

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants