Custom UI - Best Practices

What was the issue ?

I have a special type of FormArrays:

This takes a template (a factory how to construct the items) and when you setValue it calls the template to create the item forms:

I have forgotten not to set ‘emitEvent: false’ when adding items here, causing unnecessary updates about intermediate values.

So if the initial value was [] and you have sent [{}, {}, {}] to Squidex, the iframe control was receiving the following values:

[{}]                  // Previous: [{}, {}, {}]
[{}, {}]              // Previous: [{}]
[{}, {}, {}]          // Previous: [{}, {}]

And of course each of them was different to the previous value.

Makes sense. I did receive incremental item length for array in the valueChanged event.

Could you create a bug report for the issue?

Okay. I will create one.

1 Like

Done Custom Editor For Array Field Fires onValueChanged Events Wrongly

@Sebastian - Is there a workaround for this issue ?

No, sorry…but you can install the latest dev version.

Is it fixed already ?

Yes, you can install latest dev version.

Great !! Can you let me know the docker image tag ?

Sure…it is dev-7438

Hello - Will the fix be available as part of 7.4.0 release ?

Yes, I will prepare it tomorrow, I think. But it is not a promise.

1 Like

Hello - Any progress on 7.4 release ?

:partying_face:

2 Likes

@Sebastian - I see that the valueChanged event is getting fired in the latest 7.4 release. In my array there are 425 items and when I change their position using custom UI, I see valueChanged getting fired a minimum of three times.

Can you please double check ? I’m checking on my side to make sure that I’m indeed using 7.4 release .

Can you provide me your sample / custom editor again?

I will message you the drive link to the app.

@Sebastian - I’ve messaged you the link to the sample app. The schema and use case I’m trying are same as that we discussed earlier and is part of this ticket.