Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: Fix DynamicListForm state confusion on removals
When deleting an item, set it to `undefined` (i.e. keep it as a hole in `list`) instead of completely removing it. Before, removing the first item shifted all the indexes around, which broke keys/ids and the state handling, so that it appeared as if the wrong element got deleted. With that, `list.length` becomes meaningless. Adjust the emptiness check in the render function. Entirely drop `itemCount` -- nothing uses that, and it's a bit expensive to compute, so let's only introduce this when there is an actual use case. https://issues.redhat.com/browse/RHEL-19598
- Loading branch information