fix(clients): stop the Edit Client modal showing a stray light scrollbar

The client form body is capped at the viewport and scrolls internally
(49ef1449). Every tab ends with a Form.Item that keeps antd's 24px bottom
margin, so when the fields themselves fit, that empty margin alone pushed
the body past the cap: 752px of content in 740px at a 900px window. The
last item of each tab now drops the margin, so the body scrolls only when
real content overflows.

When it does scroll, the bar was painted light inside the dark modal: the
dark themes set body.dark and data-theme but never color-scheme, which is
what native scrollbars read. applyDom (panel, login and subscription
bundles) and the Storybook decorator now set it on the root element.
This commit is contained in:
Sanaei committed 2026-09-15 22:04:00 +02:00 Unverified
1 parent 14b92fbcff
commit e8bab17c2f
5 files changed
+40 -2

No files matched your search

+1
View File
@@ -22,6 +22,7 @@ export const withTheme: Decorator = (Story, context) => {
useLayoutEffect(() => {
document.body.classList.remove('dark', 'light');
document.body.classList.add(dark ? 'dark' : 'light');
document.documentElement.style.colorScheme = dark ? 'dark' : 'light';
document.documentElement.removeAttribute('data-theme');
}, [dark]);
return (
+2
View File
@@ -15,6 +15,8 @@ function readBool(key: string, fallback: boolean): boolean {
function applyDom(isDark: boolean, isUltra: boolean) {
document.body.classList.remove('dark', 'light');
document.body.classList.add(isDark ? 'dark' : 'light');
// Native scrollbars read color-scheme, not the body class.
document.documentElement.style.colorScheme = isDark ? 'dark' : 'light';
if (isUltra) {
document.documentElement.setAttribute('data-theme', 'ultra-dark');
} else {
@@ -0,0 +1,5 @@
/* The body is capped at the viewport and scrolls; a trailing item margin
alone must not push it past the cap and summon a scrollbar. */
.client-form-modal .ant-tabs-content > .ant-form-item:last-child {
margin-bottom: 0;
}
Loaded 3 of 5 files, more files were not shown because too many files have changed in this diff. Show more