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

Avoid page jump after folding a header block #7785

Closed
88250 opened this issue Mar 27, 2023 · 8 comments
Closed

Avoid page jump after folding a header block #7785

88250 opened this issue Mar 27, 2023 · 8 comments
Assignees
Milestone

Comments

@88250
Copy link
Member

88250 commented Mar 27, 2023

@88250 88250 added this to the backlog milestone Mar 27, 2023
@88250 88250 changed the title 改进折叠标题块后页面大幅跳动 Improved page jump after folding heading block Mar 29, 2023
@HowcanoeWang
Copy link

The page jump also happens if the pages contains too many images, when redirected from the "cross-ref blocks"
当从块引用的链接跳转到一个有很多图片的文档时,图片加载完毕后也会触发页面跳动,等待图片加载完毕后,再从块引用链接跳转才不会出现

@88250
Copy link
Member Author

88250 commented Mar 30, 2023

@HowcanoeWang 图片的高度似乎无法计算。

@HowcanoeWang
Copy link

HowcanoeWang commented Mar 30, 2023

@HowcanoeWang 图片的高度似乎无法计算。

可以参考打字机模式,强制从块引用跳转的块 (或聚焦的块) 在屏幕中间(或顶部)垂直居中?

PS:局部加载的大文档,从页面标题大纲中跳转,也会出现这个问题,需要等待加载完毕后,再点击才行

@88250 88250 modified the milestones: backlog, 2.8.5 Apr 11, 2023
@88250 88250 modified the milestones: 2.8.5, 2.8.6, backlog Apr 17, 2023
@88250 88250 changed the title Improved page jump after folding heading block Avoid page jump after folding a header block May 1, 2023
@88250 88250 modified the milestones: backlog, 2.8.7 May 1, 2023
@88250
Copy link
Member Author

88250 commented May 1, 2023

@HowcanoeWang 对于图片加载的情况目前没有好的解决方案,因为图片加载完以后会把高度撑高,导致定位不准。

@HowcanoeWang
Copy link

HowcanoeWang commented May 1, 2023

@HowcanoeWang 对于图片加载的情况目前没有好的解决方案,因为图片加载完以后会把高度撑高,导致定位不准。

有没有可能通过给图片块记录高度信息,然后加载的时候先把高度计算好,用空白块先把图片“撑”起来,然后后续再把图片显示出来?

keep1

(添加图片的时候记录,以及对于已经添加的图片,后续成功加载的时候也记录一下)

@88250
Copy link
Member Author

88250 commented May 1, 2023

这个方案不行的,因为实际渲染大小是自适应界面大小的,高度会随着界面大小变化而变化,无法计算出绝对位置。

@HowcanoeWang
Copy link

HowcanoeWang commented May 1, 2023

这个方案不行的,因为实际渲染大小是自适应界面大小的,高度会随着界面大小变化而变化,无法计算出绝对位置。

我的想法是,图片渲染的显示逻辑修改一下,在元信息中记录图片的高宽比之后(而不是高度的具体像素),根据页面大小,先计算出图片容器的大小,然后图片后续只能在这个容器里加载出来

(类似于准备好0.001kb的超小图片,可以瞬间加载完把界面撑起来,然后再进行跳转的定位,后续再实现对图片进行替换

Vanessa219 added a commit that referenced this issue May 3, 2023
@Vanessa219
Copy link
Member

只要是加载都会抖动

Vanessa219 added a commit that referenced this issue May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants