enforce maxRows on Arrays and Blocks
This commit is contained in:
@@ -180,6 +180,7 @@ const RenderArray = React.memo((props) => {
|
||||
value,
|
||||
readOnly,
|
||||
minRows,
|
||||
maxRows,
|
||||
} = props;
|
||||
|
||||
return (
|
||||
@@ -240,7 +241,7 @@ const RenderArray = React.memo((props) => {
|
||||
</div>
|
||||
)}
|
||||
</Droppable>
|
||||
{!readOnly && (
|
||||
{(!readOnly && (rows.length < maxRows || maxRows === undefined)) && (
|
||||
<div className={`${baseClass}__add-button-wrap`}>
|
||||
<Button
|
||||
onClick={() => addRow(value)}
|
||||
|
||||
@@ -198,6 +198,7 @@ const RenderBlocks = React.memo((props) => {
|
||||
blocks,
|
||||
readOnly,
|
||||
minRows,
|
||||
maxRows,
|
||||
} = props;
|
||||
|
||||
return (
|
||||
@@ -282,7 +283,7 @@ const RenderBlocks = React.memo((props) => {
|
||||
)}
|
||||
</Droppable>
|
||||
|
||||
{!readOnly && (
|
||||
{(!readOnly && (rows.length < maxRows || maxRows === undefined)) && (
|
||||
<div className={`${baseClass}__add-button-wrap`}>
|
||||
<Popup
|
||||
buttonType="custom"
|
||||
|
||||
Reference in New Issue
Block a user