builder icon indicating copy to clipboard operation
builder copied to clipboard

React Native SDK: Object Input returns unexpected structure

Open TGTGamer opened this issue 3 years ago • 1 comments

Describe the bug Object Input returns an unexpected object structure.

The object as specified in custom components:

{
	name: 'latitude',
	type: 'object',
	defaultValue: {
		value: -2.089913,
		delta: 3,
	},
	subFields: [
		{
			name: 'value',
			type: 'number',
			required: true,
		},
		{
			name: 'delta',
			type: 'number',
			required: true,
		},
	],
},

The object as returned viaconsole.log(props)

{
    "value": -2.089913, // this is the default passed down
    "delta": 3,
    "latitude": {
        "value": 46.082854 // this is the actual value we want
    }
}

Expected behavior Returned object should be

{
    "delta": 3,
    "value": 46.082854
}

TGTGamer avatar Nov 16 '22 13:11 TGTGamer

@TGTGamer does this still exist in the latest version? We made some changes to how default values are handled for inputs

samijaber avatar Jan 31 '23 17:01 samijaber