Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oc-client-browser",
"version": "2.1.5",
"version": "2.1.6",
"description": "OC browser client",
"main": "index.js",
"types": "index.d.ts",
Expand Down
15 changes: 14 additions & 1 deletion src/oc-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,20 @@ export function createOc(oc) {
}

if (this.#manageLifecycle) {
oc.renderNestedComponent(this, () => {});
if (this.getAttribute("loading") === "lazy") {
const observer = new IntersectionObserver((entries) => {
for (const entry of entries) {
if (entry.isIntersecting) {
observer.disconnect();
oc.renderNestedComponent(this, () => {});
break;
}
}
});
observer.observe(this);
} else {
oc.renderNestedComponent(this, () => {});
}
}
}

Expand Down