Compare commits

3 Commits

Author SHA1 Message Date
0f01a1f154 chore: add dependabot configuration for automated dependency updates 2026-01-13 19:34:01 +00:00
949cc0b5b5 Merge pull request #16 from jimeh/claude/fix-ios-toggle-sizing-KsskV 2026-01-13 18:39:55 +00:00
Claude
42260f46b5 fix: resolve iOS toggle indicator sizing on initial page load
Wait for fonts to load and use double requestAnimationFrame before
measuring toggle button dimensions. This ensures layout is complete
before calculating indicator position, fixing the visual glitch on
iOS Safari where the toggle appeared incorrectly sized until toggled.
2026-01-13 18:27:44 +00:00
2 changed files with 42 additions and 3 deletions

24
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
---
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
- package-ecosystem: npm
directory: /
schedule:
interval: monthly
groups:
npm-development:
dependency-type: development
update-types:
- major
- minor
- patch
npm-production:
dependency-type: production
update-types:
- major
- minor
- patch

View File

@@ -446,9 +446,24 @@ const previewHtml = await unified()
}
}
// Initialize indicator position on load
if (togglePreview) {
updateIndicator(togglePreview);
// Initialize indicator position after layout is complete
// Use double requestAnimationFrame to ensure layout/paint is finished,
// which fixes sizing issues on iOS Safari initial page load
function initializeIndicator() {
if (togglePreview) {
requestAnimationFrame(() => {
requestAnimationFrame(() => {
updateIndicator(togglePreview);
});
});
}
}
// Wait for fonts to load before measuring, then initialize
if (document.fonts && document.fonts.ready) {
document.fonts.ready.then(initializeIndicator);
} else {
initializeIndicator();
}
// Toggle event listeners