vueform/builder

Cloning a container with fields gives the container a unique name but not the fields within

Closed this issue · 6 comments

Environment

@vueform/builder ^1.3.2
@vueform/vueform ^1.9.4

Reproduction

.

Describe the bug

  1. Have a container with fields in it
  2. Clone the container
  3. The container receives a unique name but the fields inside the container does not
Cursor_and_Ändra_formuläret_för_Nobis_-_Selfcheck

The container with a field before cloning

Cursor_and_Ändra_formuläret_för_Nobis_-_Selfcheck

The cloned container receives a unique name, the field within does not

Additional context

No response

Logs

No response

I guess it's a similar issue I have too. It creates two elements both named text_1 and when I submit the form it overrides the second one even though it's correctly rendered on page.

Screen.Recording.2024-04-22.at.17.42.18.mov

Hello @adamberecz, any updates on this bug?

I'm currently working on this. It can be expected in the upcoming release.

The original issue got resolved in 1.4.3. Now, when a container is cloned all of its child elements will be renamed to the first available order.

The second (related) issue, reported by @sallminrexhadocumerge has also got addressed. We can't disallow having the same element name twice, because eg. in a nested container (ObjectElement) like billing_address, shipping_address you should be able to use the same field names. However if they are in a non-nested container (GroupElement) their data indeed would conflict. We already had a mechanism that checks for these duplicates and there was a warning about them, but in the model preview panel. These errors now got more explicit, showing the exact elements with this issue both in the form layout and on the element's panel.

Screenshot 2024-05-10 at 10 46 08

Thanks! Just upgraded and it works, will be a much appreciated bugfix for our users 🙏