mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 07:38:13 +00:00
fix(client): fix core component bug and warnings
This commit is contained in:
parent
c1d71ec996
commit
f019924129
@ -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,
|
||||
|
@ -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();
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user