Skip to content
Discussion options

You must be logged in to vote

No, self-driven mode is tied to the window viewport, so you need controlled mode there.

The whole of self-driven progress is these three lines in src/ThermalReceipt.tsx:

const rect = sec.getBoundingClientRect();
const track = rect.height - innerHeight;
progressRef.current = track > 0 ? clamp01(-rect.top / track) : 0;

getBoundingClientRect().top is measured against the viewport, not against the nearest scrolling ancestor, and innerHeight is the window height. Inside a modal with overflow: auto both are wrong for you: rect.top barely moves while the modal scrolls, and track is computed against a viewport that is taller than the box the receipt actually lives in. If the modal happens to be f…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by aron-intframe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant