How to limit the number of data in list type for custom component

I want to limit the number of data insertion for sublist beyond that no more data should be added untill previous data is deleted how can i achieve that in builder.io? I have tried using onChange it is working fine for list but if there are sublist inside my list and i want to apply limit to sublist using onChange it is not working.

Note- List limit with onChange is also working locally once it is deployed it is also not working

@manish-sharma could you please help me with this I have tried using onChange to limit the data to 4 but still the data is getting added, I am using builder svelte sdk 1.0.15

Hello @Prashant,

Currently, limiting the number of subfields of a list type and implementing onChange functionality for individual subfields are not directly supported features. The onChange event works with the parent input, affecting the entire list rather than specific subfields.

However, I’m actively exploring potential workarounds to address your requirements. I’ll keep you updated on any progress or alternative solutions I find.

1 Like

Thank you @manish-sharma , it would be really helpful as i am currently implementing something where i want to limit the data the user can enter.

Hello @Prashant,

Unfortunately, there isn’t currently a method to limit the number of subfields within a list type. Despite our efforts to find a workaround, we haven’t had success. One potential option is to create another custom component specifically for those subfields and use them as sub-child components. You can find more information on sub-child components at the link below: