-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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(image,avatar): not trigger error event when set lazy
only
#5567
base: main
Are you sure you want to change the base?
fix(image,avatar): not trigger error event when set lazy
only
#5567
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #5567 +/- ##
=======================================
Coverage 61.08% 61.08%
=======================================
Files 1107 1107
Lines 23618 23616 -2
Branches 6186 6184 -2
=======================================
Hits 14426 14426
+ Misses 7598 7596 -2
Partials 1594 1594 ☔ View full report in Codecov by Sentry. |
lazy
onlylazy
only
8fede04
to
df002c3
Compare
df002c3
to
6b9c9e3
Compare
fd30097
to
a2c638c
Compare
大佬~这个问题是不是暂时还没修复 |
还没合进版本,等作者合😄 |
好的捏 |
依旧没有合并? |
明天我同步下代码,再问问作者 |
a2c638c
to
8e29b5b
Compare
@07akioni 大佬什么时候有空看下这个修复 |
closes #6110
lazy
配合intersection-observer-options
配置,使用 observe 实现的懒加载存在问题;改动的思路考虑了以下两种情况:document.documentElement
改为了document
根节点(应该要跟未指定 root 时一样吧,看了 w3c 的说明 intersectionobserver-intersection-root 未指定 root 默认也是 document 节点);否则如果采用document.documentElement
(指向 html 元素),html 元素的像素高度可能为 0(例如官方文档布局采用了绝对定位),导致entry.isIntersecting
会永远为 true,图片不管是不是在浏览器视口内都会直接加载,采用 document 就解决了这个问题;