Skip to content

fix: prevent permanent isScrolling lock when tab is backgrounded#4

Open
jaredgoldman wants to merge 1 commit intomainfrom
worktree-agent-ab832483901725e7b
Open

fix: prevent permanent isScrolling lock when tab is backgrounded#4
jaredgoldman wants to merge 1 commit intomainfrom
worktree-agent-ab832483901725e7b

Conversation

@jaredgoldman
Copy link
Copy Markdown
Owner

Summary

  • smoothScrollTo sets isScrolling = true at the start and only resets it inside a requestAnimationFrame callback, which is suspended when the user switches tabs — permanently locking navigation.
  • Added a setTimeout safety fallback that forces isScrolling = false after duration + 100 ms.
  • On the normal animation-complete path, clearTimeout cancels the safety timer so there is no double-reset or race.

Test plan

  • node --check scripts/navigation.js passes (no syntax errors)
  • Browser: navigate to a card, immediately switch tabs during the scroll animation, switch back — navigation should still work normally
  • Browser: normal navigation (no tab switch) continues to work as before

🤖 Generated with Claude Code

Add a safety setTimeout that forces isScrolling = false after
duration + 100ms, so navigation is never permanently blocked if
requestAnimationFrame callbacks are suspended (e.g. tab switch).
The timeout is cleared on the normal animation-complete path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented May 5, 2026

Deploy Preview for jared-goldman-portfolio ready!

Name Link
🔨 Latest commit e7f3984
🔍 Latest deploy log https://app.netlify.com/projects/jared-goldman-portfolio/deploys/69f97cfad8c4ac0008f94385
😎 Deploy Preview https://deploy-preview-4--jared-goldman-portfolio.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant