fix(client): fix core component bug and warnings

This commit is contained in:
mytharcher 2024-11-02 13:21:13 +08:00
parent c1d71ec996
commit f019924129
3 changed files with 5 additions and 6 deletions

View File

@ -8,7 +8,7 @@
*/
import { css } from '@emotion/css';
import { observer, RecursionField, useField, useFieldSchema, useForm } from '@formily/react';
import { observer, RecursionField, useField, useFieldSchema } from '@formily/react';
import { Modal, ModalProps } from 'antd';
import classNames from 'classnames';
import React, { useMemo } from 'react';
@ -43,7 +43,6 @@ export const InternalActionModal: React.FC<ActionDrawerProps<ModalProps>> = obse
const { visible, setVisible, openSize = 'middle', modalProps } = useActionContext();
const actualWidth = width ?? openSizeWidthMap.get(openSize);
const schema = useFieldSchema();
const form = useForm();
const field = useField();
const { token } = useToken();
const tabContext = useTabsContext();
@ -91,7 +90,6 @@ export const InternalActionModal: React.FC<ActionDrawerProps<ModalProps>> = obse
open={visible}
onCancel={() => {
setVisible(false, true);
form.reset();
}}
className={classNames(
others.className,

View File

@ -45,7 +45,7 @@ const useIsSubPageClosedByPageMenu = () => {
export const ActionContextProvider: React.FC<ActionContextProps & { value?: ActionContextProps }> = (props) => {
const [submitted, setSubmitted] = useState(false); //是否有提交记录
const { visible } = { ...props, ...props.value } || {};
const { visible } = { ...props, ...props.value };
const { setSubmitted: setParentSubmitted } = { ...props, ...props.value };
const service = useBlockServiceInActionButton();
const isSubPageClosedByPageMenu = useIsSubPageClosedByPageMenu();

View File

@ -228,11 +228,12 @@ const SortableRow = (props: {
const { setNodeRef, isOver, active, over } = useSortable({
id,
});
const { rowIndex, ...others } = props;
const { ref, inView } = useInView({
threshold: 0,
triggerOnce: true,
initialInView: !!process.env.__E2E__ || isInSubTable || (props.rowIndex || 0) < INITIAL_ROWS_NUMBER,
initialInView: !!process.env.__E2E__ || isInSubTable || (rowIndex || 0) < INITIAL_ROWS_NUMBER,
skip: !!process.env.__E2E__ || isInSubTable,
});
@ -266,7 +267,7 @@ const SortableRow = (props: {
}
ref(node);
}}
{...props}
{...others}
className={classNames(props.className, { [className]: active && isOver })}
/>
</InViewContext.Provider>