mimir-ui-kit 1.32.1 → 1.32.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,10 @@ import { useCallback } from "react";
|
|
2
2
|
const useAutoResizeTextArea = (textArea) => {
|
3
3
|
return useCallback(() => {
|
4
4
|
if (textArea) {
|
5
|
+
if (!textArea.value.length) {
|
6
|
+
textArea.style.height = "auto";
|
7
|
+
return;
|
8
|
+
}
|
5
9
|
textArea.style.height = "var(--textarea-height)";
|
6
10
|
const scrollHeight = textArea.scrollHeight;
|
7
11
|
textArea.style.height = `${scrollHeight}px`;
|