Skip to content

Commit

Permalink
fix(TextArea): omit showCount from fieldProps in render function
Browse files Browse the repository at this point in the history
fix(Item): handle expandedRowClassName type correctly
  • Loading branch information
chenshuai2144 committed Nov 14, 2024
1 parent 87eb331 commit 34ce674
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 7 additions & 2 deletions packages/field/src/components/TextArea/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useIntl } from '@ant-design/pro-provider';
import { Input } from 'antd';
import omit from 'omit.js';
import React from 'react';
import type { ProFieldFC } from '../../index';
import FieldTextAreaReadonly from './readonly';
Expand All @@ -15,13 +16,17 @@ import 'antd/lib/input/style';
const FieldTextArea: ProFieldFC<{
text: string;
}> = (props, ref) => {
const { text, mode, render, , fieldProps } = props;
const { text, mode, render, renderFormItem, fieldProps } = props;
const intl = useIntl();

if (mode === 'read') {
const dom = <FieldTextAreaReadonly {...props} ref={ref} />;
if (render) {
return render(text, { mode, ...omit(fieldProps, ['showCount']) }, dom);
return render(
text,
{ mode, ...(omit(fieldProps, ['showCount']) as any) },
dom,
);
}
return dom;
}
Expand Down
4 changes: 3 additions & 1 deletion packages/list/src/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,9 @@ function ProListItem<RecordType>(props: ItemProps<RecordType>) {
<div
className={
expandedRowClassName &&
expandedRowClassName(record, index, indentSize)
typeof expandedRowClassName !== 'string'
? expandedRowClassName(record, index, indentSize)
: expandedRowClassName
}
>
{expandedRowDom}
Expand Down

0 comments on commit 34ce674

Please sign in to comment.