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: insert before fixed element #930

Merged
merged 5 commits into from
Nov 30, 2021
Merged

Conversation

temper357
Copy link
Contributor

Closes #926

修复将一个 element 插入一个有定位(absolute/fixed) 的 element 之前时报错。

  • fix: 目前在 insertBefore element 时需要在 renderObject tree 上查找 element 对应的 renderObject 要插入的前一个 renderObject 位置,目前是直接取待插入 element 的 renderer,当待插入的 element 为 absolute/fixed 时,element 的 containing block 与它的原始 parent 可能并不相同,导致其 renderer 并不在其 parent 之下,这种情况下应该插入它的 renderPositionPlaceholder 之前。

@answershuto answershuto merged commit 94abb6b into main Nov 30, 2021
@answershuto answershuto deleted the fix/insert-before-fixed-element branch November 30, 2021 09:45
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.

将 element 插入一个 fixed element 之前报错
3 participants