Skip to content

Write HTML. Render video. Built for agents.

fix(runtime): show elements at exact end of their duration (inclusive boundary) (#1166)

Miguel Ángelb652c0a235ef
diff --git a/packages/core/src/runtime/init.ts b/packages/core/src/runtime/init.ts
index 5c46f7a9c6..724d3d26bf 100644
--- a/packages/core/src/runtime/init.ts
+++ b/packages/core/src/runtime/init.ts
@@ -1413,7 +1413,7 @@ export function initSandboxRuntimeModular(): void {
duration != null && duration > 0 ? start + duration : Number.POSITIVE_INFINITY;
const isVisibleNow =
state.currentTime >= start &&
- (Number.isFinite(computedEnd) ? state.currentTime < computedEnd : true);
+ (Number.isFinite(computedEnd) ? state.currentTime <= computedEnd : true);
rawNode.style.visibility = isVisibleNow ? "visible" : "hidden";
}
};