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

页面跳转或者提交Form过程中SVG动画不执行了!!! #292

Open
yaofly2012 opened this issue Apr 21, 2024 · 1 comment
Open

Comments

@yaofly2012
Copy link
Owner

yaofly2012 commented Apr 21, 2024

背景

期望在用户点击a标签或者用户提交表单(利用Form)时展示一个loading。但是发现在页面跳转或者提交Form过程中SVG动画不执行了!!!

解决方案

利用iframe加载SVG。但是效果并不好,毕竟等在线的SVG加载完毕后,原本的页面跳转或者表单提交已经完成了。

参考:

  1. 思否:在页面还未加载完毕前,svg的动画效果失效?
  2. Animated SVG stops after page reloading
  3. Safari pauses all animation on redirect / form submission
@shen774411223d
Copy link

这个和我之前遇到的问题有点相似,我想在大量计算时展示一个loading状态给用户。我猜测大量计算应该直接占满js线程 并不会继续刷新dom造成的。

点击a标签和触发form表单 这些用户触发的高优级别交互 我感觉会第一时间放到主线程里 终止其他dom交互。
是否可以通过server worker来解决? worker是否支持 a标签以及form的创建

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

2 participants