Calling chidlList.add
to add an element that's already in the childList throws "out of bounds" error
#509
Labels
chidlList.add
to add an element that's already in the childList throws "out of bounds" error
#509
We're now gradually bumping Lightning to the latest version and came across this when bumping to 2.5.0, and it should still occur in latest.
Caused by #314
This makes it so we have have to check if the item exists in the childList before calling
add
every time, at least for certain uses.Say we have an item that may be attached and detached from different childLists, as it's something like a reusable visual focus element. When we've added that item to the childList before and try to add it again, the check using
currentIndex
andindex
(in this context, the length of the array) will be incorrect. SaycurrentIndex
is 1 and the length of the childList is 2, so that's the index.This worked in 2.4.0, even if it triggered this whole flow:
Surely this could be optimized? Or is this the responsability of the application developers, and if so, shouldn't this be documented?
The text was updated successfully, but these errors were encountered: