Skip to content

fix: 打开对话框时页面不再左移半个滚动条 - #52

Merged
stqfdyr merged 2 commits into
mainfrom
fix/dialog-scroll-shift
Sep 23, 2026
Merged

stqfdyr merged 2 commits into
mainfrom
fix/dialog-scroll-shift

Conversation

@stqfdyr

@stqfdyr stqfdyr commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

页面出现滚动条、且系统滚动条占宽度(Windows、大多数 Linux 桌面)时,面板每打开一次对话框,内容就左移半个滚动条,关闭时再移回来。

html 的 scrollbar-gutter: stable 已经为滚动条留了位置,对话框锁滚动时又给 body 加上等宽的右边距,同一段宽度扣了两次。index.css 加一条规则,锁滚动时把这段边距归零。

测试:带 15px 真实滚动条的浏览器里打开编辑节点对话框,改前标题、搜索框、表格左移 7.5px,body 从 1351px 变为 1336px;改后位置与宽度均不变。npm run build、oxlint、npm test 通过。

html 的 scrollbar-gutter: stable 已经为滚动条留了位置,对话框锁滚动时又给 body 加上等宽的
右边距,同一段宽度扣了两次,居中的内容在每次打开对话框时左移半个滚动条。锁滚动时去掉这段
边距。
@stqfdyr
stqfdyr merged commit f65f806 into main Sep 23, 2026
1 check passed
@stqfdyr
stqfdyr deleted the fix/dialog-scroll-shift branch September 23, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant