fix: resolve scrollbar issue when opening page tab with full-height block (#6347)

This commit is contained in:
Katherine 2025-03-04 14:59:22 +08:00 committed by GitHub
parent 53e9ad38cd
commit 50ac2a0d85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,6 +11,7 @@ import { useFieldSchema } from '@formily/react';
import { useMemo, useContext } from 'react';
import { useBlockTemplateContext } from '../../schema-templates/BlockTemplateProvider';
import { BlockItemCardContext } from '../../schema-component/antd/block-item/BlockItemCard';
import { useCurrentRoute } from '../../route-switch';
export const useBlockHeightProps = () => {
const fieldSchema = useFieldSchema();
@ -19,13 +20,13 @@ export const useBlockHeightProps = () => {
const pageSchema = useMemo(() => getPageSchema(blockTemplateSchema || fieldSchema), []);
const { disablePageHeader, enablePageTabs, hidePageTitle } = pageSchema?.['x-component-props'] || {};
const { titleHeight } = useContext(BlockItemCardContext) || ({} as any);
const currentRoute = useCurrentRoute();
return {
heightProps: {
...cardItemSchema?.['x-component-props'],
title: cardItemSchema?.['x-component-props']?.title || cardItemSchema?.['x-component-props']?.description,
disablePageHeader,
enablePageTabs,
enablePageTabs: currentRoute.enableTabs || enablePageTabs,
hidePageTitle,
titleHeight: titleHeight,
},