Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: order same zIndex elements by updateTreeOrder #441

Merged
merged 4 commits into from
Oct 10, 2023

Conversation

jorge-graca-sky
Copy link
Contributor

@jorge-graca-sky jorge-graca-sky commented Jan 18, 2023

When elements have the same zIndex they should respect the renderTree. There is a clear attempt at that by using the updateTreeOrder to sort the elements, however the code that triggered the re-sort was removed:

38285e0
93b301b

Since this sort happens only when the tree changes it has a very very low cost, performance wise and is much better than having a wrongly ordered zIndex array.

Other suggestions to fix this bug are very welcome.

Definitely not an ideal solution, but it is better than having an wrongly ordered zIndex elements
@uguraslan uguraslan linked an issue Apr 11, 2023 that may be closed by this pull request
@jorge-graca-sky jorge-graca-sky mentioned this pull request Jul 26, 2023
2 tasks
@uguraslan uguraslan added this to the October 2023 release milestone Jul 27, 2023
@jorge-graca-sky
Copy link
Contributor Author

@uguraslan I updated the solution to be compatible with unstable Array.sort. This is only relevant on old chrome browsers, because webkit had an non-stable Array.sort algorithm.

Copy link
Contributor

@wouterlucas wouterlucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@uguraslan uguraslan merged commit 6963b82 into rdkcentral:dev Oct 10, 2023
@uguraslan uguraslan mentioned this pull request Oct 11, 2023
2 tasks
@jorge-graca-sky jorge-graca-sky deleted the patch-2 branch October 11, 2023 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Bad zSorting when zIndex is the same
3 participants