mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 09:17:23 +00:00
fix(core): cannot add a record block in new tab in Drawer (#3196)
This commit is contained in:
parent
fb656286e3
commit
823a112435
@ -1,6 +1,6 @@
|
||||
import { useForm } from '@formily/react';
|
||||
import React, { useMemo } from 'react';
|
||||
import { SchemaComponent, useActionContext, useDesignable, useRecordIndex } from '../..';
|
||||
import { SchemaComponent, useActionContext, useDesignable, useRecord } from '../..';
|
||||
import { SchemaInitializer } from '../../application/schema-initializer/SchemaInitializer';
|
||||
import { useGetAriaLabelOfSchemaInitializer } from '../hooks/useGetAriaLabelOfSchemaInitializer';
|
||||
|
||||
@ -9,15 +9,15 @@ export const TabPaneInitializers = (props?: any) => {
|
||||
const { isCreate, isBulkEdit, options } = props;
|
||||
const { gridInitializer } = options;
|
||||
const { getAriaLabel } = useGetAriaLabelOfSchemaInitializer();
|
||||
const record = useRecord();
|
||||
|
||||
const useSubmitAction = () => {
|
||||
const form = useForm();
|
||||
const ctx = useActionContext();
|
||||
const index = useRecordIndex();
|
||||
let initializer = gridInitializer;
|
||||
if (!initializer) {
|
||||
initializer = 'RecordBlockInitializers';
|
||||
if (isCreate || index === null) {
|
||||
if (isCreate || !record) {
|
||||
initializer = 'CreateFormBlockInitializers';
|
||||
} else if (isBulkEdit) {
|
||||
initializer = 'CreateFormBulkEditBlockInitializers';
|
||||
|
Loading…
Reference in New Issue
Block a user