fix: calc scrollheight dynamically for tabs change
This commit is contained in:
@@ -4,33 +4,22 @@ import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import React from 'react';
|
||||
import { DeployFormKeyMap } from '../config';
|
||||
import { useCatalogFormContext, useFormContext } from '../config/form-context';
|
||||
import { useFormContext } from '../config/form-context';
|
||||
import { FormData } from '../config/types';
|
||||
|
||||
/**
|
||||
* It can access some props from CatalogFormContext
|
||||
*/
|
||||
const CatalogForm: React.FC = () => {
|
||||
const intl = useIntl();
|
||||
const formCtx = useFormContext();
|
||||
const catalogFormCtx = useCatalogFormContext();
|
||||
const { getRuleMessage } = useAppUtils();
|
||||
const { formKey } = formCtx;
|
||||
const {
|
||||
sizeOptions,
|
||||
quantizationOptions,
|
||||
onSizeChange,
|
||||
onQuantizationChange
|
||||
} = catalogFormCtx;
|
||||
|
||||
if (formKey !== DeployFormKeyMap.CATALOG) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const handleSizeChange = (val: any) => {
|
||||
onSizeChange?.(val);
|
||||
};
|
||||
|
||||
const handleOnQuantizationChange = (val: any) => {
|
||||
onQuantizationChange?.(val);
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<Form.Item<FormData>
|
||||
|
||||
Reference in New Issue
Block a user