Bad zSorting when zIndex is the same

Hi, I have been investigating why some Elements randomly pop in front of other in our app. This has revealed a bug in the lightning’s zSorting algorithm, it does not sort Elements with the same zIndex by updateTreeOrder.

The issue is on sortZIndexedChildren of ElementCore, on lines 2062 “// Merge-sort arrays;” it assumes both arrays are sorted, however same zIndex items may not be (since _updateTreeOrder change does not trigger _zIndexResort = true the a array may have unsorted items)

The logic that ensured this was removed on version 1.0.4: performance(updateTreeOrder): refactor, make simpler and (in most cas… · rdkcentral/Lightning@38285e0 · GitHub

Any ideas on how to fix it?

Can you file this as an issue on the Lightning github - Thanks! @michiel FYI

1 Like