Error and inconcistency when deleting form element after reordering

Created on 3 April 2025, about 1 month ago

Problem/Motivation

When you reorder form elements and delete one element, you get an error:

"The submitted value -XX in the Weight for XXX element is not allowed."

Also the order of the elements seems to be returned to its original state after the deletion, but after saving the form, the elements are once again in the reordered state.

See attached video for an example.

Steps to reproduce

  1. Open a form with multiple elements.
  2. Reorder the elements.
  3. Delete one element -> you get the error.
  4. See that the order of the elements is the original order.
  5. Save the form -> the order is now the reorded one.

Proposed resolution

There should be no error when deleting an element after reorder. The order of the elements should be consistent between these steps.

🐛 Bug report
Status

Active

Version

6.3

Component

Code

Created by

🇫🇮Finland Tuuuukka

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Tuuuukka
  • 🇮🇳India sorabh.v6 Indore

    Starting to work on this issue.

  • @sorabhv6 opened merge request.
  • 🇮🇳India sorabh.v6 Indore

    I have created the MR. I worked on it for so much time. Initially, I thought I could just add the validation and then I see that element validations are different than form validation itself and event that didn't worked because there was not identifier to know if the element weight is changed.

    The better and I think only approach to solve this was doing some checking on the frontend side using the JS.

    I am adding the warning message when an element is dragged to save the form before making any changes. Even if user ignores that warning and just click on delete action link for the element then I disabled the delete button and show the same message as error in the dialog modal.

Production build 0.71.5 2024