Skip to content

Commit

Permalink
Update timeline and tick animation after subject size change
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesodland committed Feb 3, 2024
1 parent 4752cac commit 80c3e2d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/scroll-timeline-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,11 @@ export class ViewTimeline extends ScrollTimeline {
details.inset = parseInset(options.inset);
}
if (details.subject) {
const resizeObserver = new ResizeObserver(() => {
updateMeasurements(details.source)
})
resizeObserver.observe(details.subject)

const mutationObserver = new MutationObserver(() => {
updateMeasurements(details.source);
});
Expand Down

0 comments on commit 80c3e2d

Please sign in to comment.