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 zindex bug #1978

Closed
wants to merge 1 commit into from
Closed

fix zindex bug #1978

wants to merge 1 commit into from

Conversation

ConcealGeek
Copy link

@ConcealGeek ConcealGeek commented Aug 20, 2019

Since my English sucks, machine translation can only be translated!
i found one problem.
if we have a html like:
https://codepen.io/tianchouczl/pen/PoYGOQK

if the numbers of absolute positioning div > 2 have this bug

in stacking-context.ts lines:113-122
let index = 0; parentStack.positiveZIndex.some((current, i) => { if (order > current.element.container.styles.zIndex.order) { index = i + 1; return true; } return false; }); parentStack.positiveZIndex.splice(index, 0, stack);

this index not true. we should found the index which is less then order.but this code, if u got the first order less then order, u return true.This is not what we want.
example:
if parentStack.positiveZIndex have two index [1,2]
and we give a order = 3
in this code ,we got parentStack.positiveZIndex = [1,3,2],
but we need [1,2,3]

niklasvh added a commit that referenced this pull request Sep 22, 2019
niklasvh added a commit that referenced this pull request Sep 22, 2019
* fix zindex bug

* test: add z-index reftest for #1978

* fix: z-index ordering early exit
pawelzwronek pushed a commit to pawelzwronek/html2canvas that referenced this pull request Oct 13, 2019
* fix zindex bug

* test: add z-index reftest for niklasvh#1978

* fix: z-index ordering early exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant