You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you submitting a bug report or a feature request?
Bug report
What is the current behavior?
After moving fields with different shapes, some fields' change, blur and focus functions were gone.
What is the expected behavior?
Maybe these functions should be restored or recreated.
test case below would fail with TypeError: state.fields.foo[1].cat.change is not a function
it('should preserve functions in field state when fields with different shapes',()=>{// implementation of changeValue taken directly from Final FormconstchangeValue=(state,name,mutate)=>{constbefore=getIn(state.formState.values,name)constafter=mutate(before)state.formState.values=setIn(state.formState.values,name,after)||{}}conststate={formState: {values: {foo: [{dog: 'apple dog',cat: 'apple cat'},{dog: 'banana dog'}]}},fields: {'foo[0].dog': {name: 'foo[0].dog',touched: true,error: 'Error A Dog',change: ()=>'A Dog'},'foo[0].cat': {name: 'foo[0].cat',touched: false,error: 'Error A Cat',change: ()=>'A Cat'},'foo[1].dog': {name: 'foo[1].dog',touched: true,error: 'Error B Dog',change: ()=>'B Dog',}}}move(['foo',0,1],state,{ changeValue })expect(state.formState).toMatchObject({values: {foo: [{dog: 'banana dog'},{dog: 'apple dog',cat: 'apple cat'}]}})expect(state.fields['foo[0].dog'].change()).toBe('A Dog')expect(state.fields['foo[1].dog'].change()).toBe('B Dog')// this expect would fail with `TypeError: state.fields.foo[1].cat.change is not a function`expect(state.fields['foo[1].cat'].change()).toBe('A Cat')})
What's your environment?
"final-form-arrays": "3.0.2",
Other information
The text was updated successfully, but these errors were encountered:
Are you submitting a bug report or a feature request?
Bug report
What is the current behavior?
After moving fields with different shapes, some fields' change, blur and focus functions were gone.
What is the expected behavior?
Maybe these functions should be restored or recreated.
test case below would fail with
TypeError: state.fields.foo[1].cat.change is not a function
What's your environment?
Other information
The text was updated successfully, but these errors were encountered: