Skip to content

Commit dba19fb

Browse files
enf0rc3claude
andcommitted
Keep the collapse jump instant
The autofix on the pull request swapped behavior: 'instant' for 'auto'. 'auto' defers to the CSS, and main.css sets scroll-behavior: smooth on html for anyone without a reduced-motion preference, so the jump animated again. 'instant' is CSSOM View and has been in every current browser since 2023. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 4750a34 commit dba19fb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/scripts/modules/code-blocks.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ function addCollapseListeners() {
184184
// the top of it rather than wherever that height ran out. Instant,
185185
// because animating a jump this large only reads as lag.
186186
if (!expanded) {
187-
block.scrollIntoView({ block: 'start', behavior: 'auto' });
187+
// 'instant' rather than 'auto': the site sets scroll-behavior: smooth
188+
// on html, and 'auto' would defer to it and animate the jump.
189+
block.scrollIntoView({ block: 'start', behavior: 'instant' });
188190
}
189191
return;
190192
}

0 commit comments

Comments
 (0)