mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
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:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user