Browse Source

fix(@vben/common-ui): keep auto-height Page from clamping outer flex layout (#8323)

When the layout footer is enabled and not fixed, LayoutContent is a flex
item of the scroll container with min-height:auto. An auto-content-height
Page then feeds its inner content's min-content height back into that
automatic minimum, so the content region gets clamped taller than the
available space on first render: the layout footer is pushed below the
viewport and the page's own scrollbar only appears after switching tabs
(the KeepAlive remount breaks the feedback loop). See #5677.

Apply size containment to the Page content region in auto-content-height
mode so it no longer contributes min-content height to the outer flex
layout; the region manages its own scrolling there by design.
changeset-release/main
俞可 · YU KE 1 month ago
committed by GitHub
parent
commit
f312a2f9f0
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      packages/effects/common-ui/src/components/page/page.vue

6
packages/effects/common-ui/src/components/page/page.vue

@ -24,6 +24,12 @@ const contentStyle = computed<StyleValue>(() => {
return {
'--page-content-height-offset': `${heightOffset}px`,
// In auto-content-height mode the content region manages its own scrolling.
// Size containment prevents the inner content's min-content height from
// feeding back into the outer flex layout, which would clamp the content
// region taller than the available space and push the layout footer below
// the viewport (see https://github.com/vbenjs/vue-vben-admin/issues/5677).
contain: 'size',
marginBlockEnd: 'var(--page-content-height-offset)',
};
});

Loading…
Cancel
Save