diff --git a/semcore/bulk-textarea/src/BulkTextarea.tsx b/semcore/bulk-textarea/src/BulkTextarea.tsx index f821c6c5b1..f9c45c4d70 100644 --- a/semcore/bulk-textarea/src/BulkTextarea.tsx +++ b/semcore/bulk-textarea/src/BulkTextarea.tsx @@ -76,7 +76,7 @@ class BulkTextareaRoot extends Component< readonly, pasteProps, } = this.asProps; - const { errors, errorIndex, showErrors, lastError } = this.state; + const { errors, errorIndex, showErrors, lastError, rowsCount } = this.state; return { value, @@ -90,6 +90,7 @@ class BulkTextareaRoot extends Component< placeholder, lastError, pasteProps, + rowsCount, onChangeRowsCount: this.handleChangeRowsCount, onEnterNextRow: () => { if (validateOn?.includes('enterNextRow')) { diff --git a/semcore/bulk-textarea/src/components/InputField/InputField.tsx b/semcore/bulk-textarea/src/components/InputField/InputField.tsx index 24789f1d6d..5377f5f444 100644 --- a/semcore/bulk-textarea/src/components/InputField/InputField.tsx +++ b/semcore/bulk-textarea/src/components/InputField/InputField.tsx @@ -31,6 +31,7 @@ class InputField extends Component { - let rowsCount = 0; - const { ofRows } = this.asProps; + let rows = 0; + const { ofRows, rowsCount } = this.asProps; this.textarea.childNodes.forEach((node, index) => { if (node instanceof HTMLParagraphElement) { @@ -696,18 +697,17 @@ class InputField extends Component ofRows) { + if (rows > ofRows) { node.dataset.overMaxRows = 'true'; } } } }); - if (this.rowsCount !== rowsCount) { - this.rowsCount = rowsCount; - this.asProps.onChangeRowsCount(rowsCount); + if (rowsCount !== rows) { + this.asProps.onChangeRowsCount(rows); } }, 100); } diff --git a/semcore/bulk-textarea/src/components/InputField/InputField.types.ts b/semcore/bulk-textarea/src/components/InputField/InputField.types.ts index f39fd03128..487a0d3d8b 100644 --- a/semcore/bulk-textarea/src/components/InputField/InputField.types.ts +++ b/semcore/bulk-textarea/src/components/InputField/InputField.types.ts @@ -120,6 +120,10 @@ export type InputFieldProps = { */ currentRowIndex: number; + /** + * Internal + */ + rowsCount: number; /** * Internal */