CodeRAD icon indicating copy to clipboard operation
CodeRAD copied to clipboard

Rapidly adding and removing items from EntityListView results in duplications

Open Rocketeer007 opened this issue 2 years ago • 0 comments

Given a sequence of add, remove, add events on an EntityList, the EntityListView can end up showing incorrect items. For example:

entityList.add(a);
entityList.remove(a);
entityList.add(a);

The root cause of this appears to be that after adding item a, the wrapper in EntityListView is not fully updated; the new component is added to the changeQueue, but is not yet returned when iterating through elements in EntityListView.handleEntityRemoved

To resolve this, I think that EntityListView.handleEntityRemoved should instead call wrapper.getChildrenAsList(true) to include the queued changes when removing items.

Rocketeer007 avatar Mar 15 '24 11:03 Rocketeer007