formio / formio.js

JavaScript powered Forms with JSON Form Builder

Home Page:https://formio.github.io/formio.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Data grid: deleting rows with HTML 5 select lists mangles the data

WalterMoar opened this issue · comments

Using v4.17.2 I've isolated this down to the simple case of:

  1. Data Grid
  2. One column in the data grid containing a Select component
  3. The Widget Type of the select list is HTML 5
  4. The "Data" for the select is One (value "one") and Two (value "two")

In this type of form, the following error happens:

  1. Choose "One" for the first select
  2. Add another row
  3. Choose "Two" for the second select
  4. Delete the first row ("One")

Expected: one row with the value Two. Actual: one row with the value One.

Workaround 1: Use ChoicesJS. Not an option because of #5229
Workaround 2: Use numeric values (1, 2) instead of strings (one, two). Not an option because it reduces the "readability" of the data.

Note: our real-world form actually has the problem that when a row is deleted then some of that row's data is merged into the data from the following row - but above is the simplest case.