@idealyst/components 1.2.67 → 1.2.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idealyst/components",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.68",
|
|
4
4
|
"description": "Shared component library for React and React Native",
|
|
5
5
|
"documentation": "https://github.com/IdealystIO/idealyst-framework/tree/main/packages/components#readme",
|
|
6
6
|
"readme": "README.md",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"publish:npm": "npm publish"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@idealyst/theme": "^1.2.
|
|
59
|
+
"@idealyst/theme": "^1.2.68",
|
|
60
60
|
"@mdi/js": ">=7.0.0",
|
|
61
61
|
"@mdi/react": ">=1.0.0",
|
|
62
62
|
"@react-native-vector-icons/common": ">=12.0.0",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"@idealyst/blur": "^1.2.40",
|
|
110
|
-
"@idealyst/theme": "^1.2.
|
|
110
|
+
"@idealyst/theme": "^1.2.68",
|
|
111
111
|
"@idealyst/tooling": "^1.2.30",
|
|
112
112
|
"@mdi/react": "^1.6.1",
|
|
113
113
|
"@types/react": "^19.1.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState, forwardRef, useMemo } from 'react';
|
|
1
|
+
import { useState, forwardRef, useMemo, useEffect } from 'react';
|
|
2
2
|
import { View, TextInput, NativeSyntheticEvent, TextInputContentSizeChangeEventData } from 'react-native';
|
|
3
3
|
import { textAreaStyles } from './TextArea.styles';
|
|
4
4
|
import Text from '../Text';
|
|
@@ -141,6 +141,14 @@ const TextArea = forwardRef<IdealystElement, TextAreaProps>(({
|
|
|
141
141
|
setContentHeight(newHeight);
|
|
142
142
|
};
|
|
143
143
|
|
|
144
|
+
// Reset contentHeight when value is cleared externally (controlled component)
|
|
145
|
+
// This forces the TextInput to recalculate its size
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
if (autoGrow && value === '') {
|
|
148
|
+
setContentHeight(undefined);
|
|
149
|
+
}
|
|
150
|
+
}, [value, autoGrow]);
|
|
151
|
+
|
|
144
152
|
const showFooter = (error || helperText) || (showCharacterCount && maxLength);
|
|
145
153
|
|
|
146
154
|
// Get dynamic styles - call as functions for theme reactivity
|
|
@@ -172,10 +180,15 @@ const TextArea = forwardRef<IdealystElement, TextAreaProps>(({
|
|
|
172
180
|
textAlignVertical: autoGrow ? 'center' : 'top',
|
|
173
181
|
backgroundColor: 'transparent',
|
|
174
182
|
},
|
|
175
|
-
// For autoGrow:
|
|
183
|
+
// For autoGrow: use contentHeight if available, otherwise minHeight constraint
|
|
176
184
|
// For fixed height: use rows-based height
|
|
177
185
|
autoGrow
|
|
178
|
-
? {
|
|
186
|
+
? {
|
|
187
|
+
minHeight: minHeight ?? 44,
|
|
188
|
+
maxHeight: maxHeight,
|
|
189
|
+
// Set explicit height when we have a calculated contentHeight
|
|
190
|
+
...(contentHeight !== undefined && { height: contentHeight }),
|
|
191
|
+
}
|
|
179
192
|
: { height: rows * 24 },
|
|
180
193
|
textareaStyle,
|
|
181
194
|
]}
|