File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,7 @@ interface DndTableProps {
200200 uploadButtonMessageId ?: string ;
201201 handleResetButton ?: ( ) => void ;
202202 resetButtonMessageId ?: string ;
203+ maxRows ?: number ;
203204}
204205
205206export function DndTable ( props : Readonly < DndTableProps > ) {
@@ -224,6 +225,7 @@ export function DndTable(props: Readonly<DndTableProps>) {
224225 uploadButtonMessageId = undefined ,
225226 handleResetButton = undefined ,
226227 resetButtonMessageId = undefined ,
228+ maxRows = MAX_ROWS_NUMBER ,
227229 } = props ;
228230 const intl = useIntl ( ) ;
229231
@@ -259,16 +261,16 @@ export function DndTable(props: Readonly<DndTableProps>) {
259261 }
260262
261263 const addNewRows = ( numberOfRows : number ) => {
262- // checking if not exceeding 100 steps
263- if ( currentRows . length + numberOfRows > MAX_ROWS_NUMBER ) {
264+ // checking if not exceeding the max allowed
265+ if ( currentRows . length + numberOfRows > maxRows ) {
264266 setError ( arrayFormName , {
265267 type : 'custom' ,
266268 message : intl . formatMessage (
267269 {
268270 id : 'MaximumRowNumberError' ,
269271 } ,
270272 {
271- value : MAX_ROWS_NUMBER ,
273+ value : maxRows ,
272274 }
273275 ) ,
274276 } ) ;
You can’t perform that action at this time.
0 commit comments