Data grid: deleting rows with HTML 5 select lists mangles the data
WalterMoar opened this issue · comments
Walter Moar commented
Using v4.17.2 I've isolated this down to the simple case of:
Data Grid
- One column in the data grid containing a
Select
component - The
Widget Type
of the select list isHTML 5
- The "Data" for the select is One (value "one") and Two (value "two")
In this type of form, the following error happens:
- Choose "One" for the first select
- Add another row
- Choose "Two" for the second select
- 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.