-
Notifications
You must be signed in to change notification settings - Fork 304
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 the sliver with positioned element usage problem. #1341
Conversation
wssgcg1213
commented
Apr 21, 2022
•
edited
Loading
edited
- 修复 sliver 元素内如果有 positioned 元素,首帧创建时报错导致不显示的问题
- 修复 sliver 元素内如果有 positioned 元素,该元素的 RenderPositionPlaceholder 滚动到销毁位置时,不应该同时销毁定位的元素的问题
bb43f0c
to
64345ac
Compare
kraken/lib/src/dom/element.dart
Outdated
|
||
// Ignore the fixed element to unmount render object. | ||
// It's useful for sliver manager to unmount child render object, but excluding fixed elements. | ||
if (keepFixedAlive && _isFixed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里要不要考虑相对于 sliver layout 的 ancestor 定位的 absolute element 的 case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
display sliver 的节点本身需要被视为一个 containing block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果是这样的话,在 element 中 _findContainingBlock 中应该要加上 sliver 的判断逻辑
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里有个问题, RenderSliverListLayout 并不会 添加这个 child, 也不会给它布局或者绘制
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样的话, 一旦设置 absolute, 这个元素就不见了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个地方要不先记一个 issue 吧, 暂时不太好解决
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
或者规则定成 sliver item 是 containing block 更合理些
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
恩, 听起来可以
冲突了 |
50e396b
to
c189ad3
Compare
} | ||
|
||
void _scrollYListener() { | ||
assert(scrollListener != null); | ||
scrollListener!(scrollOffsetY!.pixels, AxisDirection.down); | ||
markNeedsPaint(); | ||
if (scrollOffsetY != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个 scrollOffsetY 为 null 是不是应该断言?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
滚动惯性过程中 节点可能解挂, 但是这个回调还在触发, 要到下一帧才会销毁