fix: page indicator stuck on page 1 due to stale closure
The IntersectionObserver callback was using currentPage from closure to initialize mostVisiblePage, but this was always stale (stuck at 0). Changed to start mostVisiblePage at 0 instead of currentPage, so it correctly tracks the most visible page across all entries without relying on stale state. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
ae057eeb24
commit
952ebc7756
|
|
@ -172,7 +172,7 @@ function PreviewContent({ formState, initialData, isScrolling = false }: Workshe
|
|||
const observer = new IntersectionObserver(
|
||||
(entries) => {
|
||||
// Find the most visible page among all entries
|
||||
let mostVisiblePage = currentPage
|
||||
let mostVisiblePage = 0
|
||||
let maxRatio = 0
|
||||
|
||||
entries.forEach((entry) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue