fix: show loading spinner reliably in Safari#94
Merged
atoomic merged 1 commit intometacpan:masterfrom Mar 15, 2026
Merged
Conversation
Safari stops rendering once form submission (page navigation) begins, which killed the setInterval-based fade-in — the overlay appeared at opacity 0 and the animation never ran, showing a blank white page. Fix: prevent default form submission, show the overlay at full opacity, use double requestAnimationFrame to guarantee a paint, then submit programmatically. The fade-in is now a CSS @Keyframes animation which is more reliable across browsers than JS timers. Also adds id="search-form" to the homepage form and fixes both forms to use `onSubmit="return doGrepping()"` so the return value is honored. Closes metacpan#37 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fix the loading overlay ("Grepping...") not appearing in Safari when performing a search.
Why
Safari stops rendering once form submission triggers page navigation. The previous implementation used
setIntervalto fade in the overlay from opacity 0 → 1, but the interval callback never fires because Safari freezes JS execution during navigation. Result: users see a blank white page instead of the spinner. (Issue #37, open since 2017.)How
doGrepping()now returnsfalseto block the native submitrequestAnimationFrame— ensures the browser completes a paint cycle (showing the overlay) before we callform.submit()programmatically@keyframesfade-in replaces the JSsetIntervalanimation — CSS animations are composited on the GPU and survive the navigation freeze in most browsersid="search-form"to the homepage form and fixed both forms to useonSubmit="return doGrepping()"so the return value is honoredTesting
node --check)Closes #37
🤖 Generated with Claude Code