It's expected that siblings sharing the same zIndex will be drawn in their "natural order" so that subviews added later are drawn after (on top of) siblings that were added first. This is currently not the case, and the result is inconsistent zIndex fighting amongst siblings. From system to system, from View to View, the draw order of a given layout is not guaranteed.
The solution would be to check if two Views share the same superview when comparing them. If they share the same zIndex and superview, then use their natural ordering for the comparison.
It's expected that siblings sharing the same zIndex will be drawn in their "natural order" so that subviews added later are drawn after (on top of) siblings that were added first. This is currently not the case, and the result is inconsistent zIndex fighting amongst siblings. From system to system, from View to View, the draw order of a given layout is not guaranteed.
The solution would be to check if two Views share the same superview when comparing them. If they share the same zIndex and superview, then use their natural ordering for the comparison.