fix(rn): 修复双层 fixed 布局导致子节点无法点击的问题#2515
Open
dos1in wants to merge 3 commits into
Open
Conversation
Collaborator
|
保留在子树内定位关系不正确了吧,本身应该是基于root定位,保留在子树内基于子树负容器定位了;还得看一下为啥portal过去会影响点击,一次portal可以为什么二次portal不行 |
Member
Author
|
应该是现在处理方式把原本有层级关系的节点因为 fixed ,现在都变成了兄弟关系的portal,导致影响点击了,我再看看更合适的处理方式。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
双层 fixed 时,外层和内层都会被各自 portal 到页面根层,原来的父子层级被拆开。发现触摸事件有问题,表现就是按钮不可点击。
可复现 demo:
修复思路:添加 portal z-index 信息。
外层 fixed:portal 到页面根。内层 fixed:只转成 absolute,保留在外层 fixed 子树内。