fix: nested z-index ordering (#2011)

* fix zindex bug

* test: add z-index reftest for #1978

* fix: z-index ordering early exit
This commit is contained in:
MoyuScript
2019-09-21 21:12:36 -07:00
parent d492fe38b3
commit 9308711e11
2 changed files with 76 additions and 0 deletions

View File

@ -104,8 +104,11 @@ const parseStackTree = (
parentStack.negativeZIndex.some((current, i) => {
if (order > current.element.container.styles.zIndex.order) {
index = i;
return false;
} else if (index > 0) {
return true;
}
return false;
});
parentStack.negativeZIndex.splice(index, 0, stack);
@ -114,6 +117,8 @@ const parseStackTree = (
parentStack.positiveZIndex.some((current, i) => {
if (order > current.element.container.styles.zIndex.order) {
index = i + 1;
return false;
} else if (index > 0) {
return true;
}