This is an automated email from the ASF dual-hosted git repository.

young pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git


The following commit(s) were added to refs/heads/master by this push:
     new b0d518137 enhance toc scrolling accuracy (#3264)
b0d518137 is described below

commit b0d518137ccdd530f506eefb62b1a650aa969986
Author: mikasaco <[email protected]>
AuthorDate: Mon Dec 8 16:23:50 2025 +0800

    enhance toc scrolling accuracy (#3264)
    
    fix(toc): correct scroll position for FormSection, enhance toc scrolling 
accuracy
    
    - change block from 'end' to 'start' in TOC click handler
    - add scroll-margin-top in css
    
    Fixes #3263
---
 src/components/form-slice/FormSection/index.tsx        | 2 +-
 src/components/form-slice/FormSection/style.module.css | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/components/form-slice/FormSection/index.tsx 
b/src/components/form-slice/FormSection/index.tsx
index f62bd9ec3..2e4ce2a9d 100644
--- a/src/components/form-slice/FormSection/index.tsx
+++ b/src/components/form-slice/FormSection/index.tsx
@@ -130,7 +130,7 @@ const TOC = (props: Pick<TableOfContentsProps, 
'reinitializeRef'>) => {
         onClick: () => {
           return data.getNode().scrollIntoView({
             behavior: 'smooth',
-            block: 'end',
+            block: 'start',
             inline: 'end',
           });
         },
diff --git a/src/components/form-slice/FormSection/style.module.css 
b/src/components/form-slice/FormSection/style.module.css
index 21376f528..71052e25f 100644
--- a/src/components/form-slice/FormSection/style.module.css
+++ b/src/components/form-slice/FormSection/style.module.css
@@ -1,5 +1,6 @@
 .root {
   margin-block: var(--mantine-font-size-md, 0);
+  scroll-margin-top: calc(var(--appshell-header-height, 60px) + 20px);
 
   & > fieldset {
     margin-bottom: 0;

Reply via email to