File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed
packages/pf4-component-mapper/src Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -95,13 +95,15 @@ const DynamicArray = ({ ...props }) => {
9595 titleDescription = { description }
9696 actions = {
9797 < 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+ < Button
100+ variant = "link"
101+ isDisabled = { value . length === 0 }
102+ { ...( value . length !== 0 && { onClick : ( ) => removeBatch ( value . map ( ( _ , index ) => index ) ) } ) }
103+ >
104+ { combinedButtonLabels . removeAll }
105+ </ Button >
106+ ) }
105107 < Button
106108 variant = "secondary"
107109 isDisabled = { value . length >= maxItems }
Original file line number Diff line number Diff line change @@ -306,7 +306,7 @@ describe('<FieldArray/>', () => {
306306 } ) ;
307307
308308 await act ( async ( ) => {
309- wrapper . find ( 'button' ) . at ( 1 ) . simulate ( 'click' ) ;
309+ wrapper . find ( 'button' ) . at ( 0 ) . simulate ( 'click' ) ;
310310 } ) ;
311311 wrapper . update ( ) ;
312312
@@ -321,7 +321,7 @@ describe('<FieldArray/>', () => {
321321 onSubmit . mockClear ( ) ;
322322
323323 await act ( async ( ) => {
324- wrapper . find ( 'button' ) . at ( 1 ) . simulate ( 'click' ) ;
324+ wrapper . find ( 'button' ) . at ( 0 ) . simulate ( 'click' ) ;
325325 } ) ;
326326 wrapper . update ( ) ;
327327
@@ -336,7 +336,7 @@ describe('<FieldArray/>', () => {
336336 onSubmit . mockClear ( ) ;
337337
338338 await act ( async ( ) => {
339- wrapper . find ( 'button' ) . at ( 1 ) . simulate ( 'click' ) ;
339+ wrapper . find ( 'button' ) . at ( 0 ) . simulate ( 'click' ) ;
340340 } ) ;
341341 wrapper . update ( ) ;
342342
You can’t perform that action at this time.
0 commit comments