Skip to content

Commit 2f21d4d

Browse files
committed
move disable-add condition not to effect array clear
1 parent b987e62 commit 2f21d4d

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

packages/ra-ui-materialui/src/input/ArrayInput/SimpleFormIterator.tsx

+11-10
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,18 @@ export const SimpleFormIterator = (props: SimpleFormIteratorProps) => {
183183
))}
184184
</ul>
185185
<div className={SimpleFormIteratorClasses.buttons}>
186-
{!disabled && !disableAdd && (
186+
{!disabled && (
187187
<div className={SimpleFormIteratorClasses.add}>
188-
{cloneElement(addButton, {
189-
className: clsx(
190-
'button-add',
191-
`button-add-${source}`
192-
),
193-
onClick: handleAddButtonClick(
194-
addButton.props.onClick
195-
),
196-
})}
188+
{!disableAdd &&
189+
cloneElement(addButton, {
190+
className: clsx(
191+
'button-add',
192+
`button-add-${source}`
193+
),
194+
onClick: handleAddButtonClick(
195+
addButton.props.onClick
196+
),
197+
})}
197198
{fields.length > 0 &&
198199
!disableClear &&
199200
!disableRemove && (

0 commit comments

Comments
 (0)