File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed
packages/pf4-component-mapper/src Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -95,13 +95,17 @@ const DynamicArray = ({ ...props }) => {
95
95
titleDescription = { description }
96
96
actions = {
97
97
< React . Fragment >
98
- < Button
99
- variant = "link"
100
- isDisabled = { value . length === 0 }
101
- { ...( value . length !== 0 && { onClick : ( ) => removeBatch ( value . map ( ( _ , index ) => index ) ) } ) }
102
- >
103
- { combinedButtonLabels . removeAll }
104
- </ Button >
98
+ { minItems > 0 ? (
99
+ ''
100
+ ) : (
101
+ < Button
102
+ variant = "link"
103
+ isDisabled = { value . length === 0 }
104
+ { ...( value . length !== 0 && { onClick : ( ) => removeBatch ( value . map ( ( _ , index ) => index ) ) } ) }
105
+ >
106
+ { combinedButtonLabels . removeAll }
107
+ </ Button >
108
+ ) }
105
109
< Button
106
110
variant = "secondary"
107
111
isDisabled = { value . length >= maxItems }
Original file line number Diff line number Diff line change @@ -306,7 +306,7 @@ describe('<FieldArray/>', () => {
306
306
} ) ;
307
307
308
308
await act ( async ( ) => {
309
- wrapper . find ( 'button' ) . at ( 1 ) . simulate ( 'click' ) ;
309
+ wrapper . find ( 'button' ) . at ( 0 ) . simulate ( 'click' ) ;
310
310
} ) ;
311
311
wrapper . update ( ) ;
312
312
@@ -321,7 +321,7 @@ describe('<FieldArray/>', () => {
321
321
onSubmit . mockClear ( ) ;
322
322
323
323
await act ( async ( ) => {
324
- wrapper . find ( 'button' ) . at ( 1 ) . simulate ( 'click' ) ;
324
+ wrapper . find ( 'button' ) . at ( 0 ) . simulate ( 'click' ) ;
325
325
} ) ;
326
326
wrapper . update ( ) ;
327
327
@@ -336,7 +336,7 @@ describe('<FieldArray/>', () => {
336
336
onSubmit . mockClear ( ) ;
337
337
338
338
await act ( async ( ) => {
339
- wrapper . find ( 'button' ) . at ( 1 ) . simulate ( 'click' ) ;
339
+ wrapper . find ( 'button' ) . at ( 0 ) . simulate ( 'click' ) ;
340
340
} ) ;
341
341
wrapper . update ( ) ;
342
342
You can’t perform that action at this time.
0 commit comments