From 2fbe5bb29e773acc8a79404c927fe4094a78ad79 Mon Sep 17 00:00:00 2001 From: Julio Rodriguez Date: Tue, 7 Jul 2026 14:23:48 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Prevent=20scroll-to-top=20on=20r?= =?UTF-8?q?estart/fast=20buttons=20in=20`termynal.js`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port of fastapi/fastapi#13714: the `restart ↻` and `fast →` controls are anchors with `href='#'`, so clicking them can navigate to `#` and jump the page to the top. Use `javascript:void(0)` instead, matching the fix already live on the FastAPI docs. Claude-Session: https://claude.ai/code/session_01HJ8JfXbXGXcAk2jEh2dZVg --- docs/js/termynal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/js/termynal.js b/docs/js/termynal.js index 45bb371c83..52362f95d8 100644 --- a/docs/js/termynal.js +++ b/docs/js/termynal.js @@ -133,7 +133,7 @@ class Termynal { this.container.innerHTML = '' this.init() } - restart.href = '#' + restart.href = "javascript:void(0)" restart.setAttribute('data-terminal-control', '') restart.innerHTML = "restart ↻" return restart @@ -147,7 +147,7 @@ class Termynal { this.typeDelay = 0 this.startDelay = 0 } - finish.href = '#' + finish.href = "javascript:void(0)" finish.setAttribute('data-terminal-control', '') finish.innerHTML = "fast →" this.finishElement = finish