Skip to content

Commit b0d5181

Browse files
authored
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
1 parent 951f319 commit b0d5181

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/components/form-slice/FormSection/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ const TOC = (props: Pick<TableOfContentsProps, 'reinitializeRef'>) => {
130130
onClick: () => {
131131
return data.getNode().scrollIntoView({
132132
behavior: 'smooth',
133-
block: 'end',
133+
block: 'start',
134134
inline: 'end',
135135
});
136136
},

src/components/form-slice/FormSection/style.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.root {
22
margin-block: var(--mantine-font-size-md, 0);
3+
scroll-margin-top: calc(var(--appshell-header-height, 60px) + 20px);
34

45
& > fieldset {
56
margin-bottom: 0;

0 commit comments

Comments
 (0)