@idealyst/components 1.2.65 → 1.2.67
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.67",
|
|
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.67",
|
|
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.67",
|
|
111
111
|
"@idealyst/tooling": "^1.2.30",
|
|
112
112
|
"@mdi/react": "^1.6.1",
|
|
113
113
|
"@types/react": "^19.1.0",
|
|
@@ -172,8 +172,11 @@ const TextArea = forwardRef<IdealystElement, TextAreaProps>(({
|
|
|
172
172
|
textAlignVertical: autoGrow ? 'center' : 'top',
|
|
173
173
|
backgroundColor: 'transparent',
|
|
174
174
|
},
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
// For autoGrow: don't set height, let it grow naturally with minHeight constraint
|
|
176
|
+
// For fixed height: use rows-based height
|
|
177
|
+
autoGrow
|
|
178
|
+
? { minHeight: minHeight ?? 44, maxHeight: maxHeight }
|
|
179
|
+
: { height: rows * 24 },
|
|
177
180
|
textareaStyle,
|
|
178
181
|
]}
|
|
179
182
|
value={value}
|
|
@@ -184,7 +187,9 @@ const TextArea = forwardRef<IdealystElement, TextAreaProps>(({
|
|
|
184
187
|
placeholder={placeholder}
|
|
185
188
|
editable={!disabled}
|
|
186
189
|
multiline
|
|
187
|
-
|
|
190
|
+
// Disable internal scrolling when autoGrow - let the TextInput expand instead
|
|
191
|
+
scrollEnabled={!autoGrow || (maxHeight !== undefined && contentHeight !== undefined && contentHeight >= maxHeight)}
|
|
192
|
+
numberOfLines={autoGrow ? undefined : rows}
|
|
188
193
|
maxLength={maxLength}
|
|
189
194
|
placeholderTextColor="#999"
|
|
190
195
|
/>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useRef, useEffect, forwardRef, useMemo } from 'react';
|
|
1
|
+
import React, { useState, useRef, useEffect, forwardRef, useMemo, useCallback } from 'react';
|
|
2
2
|
import { getWebProps } from 'react-native-unistyles/web';
|
|
3
3
|
import { textAreaStyles } from './TextArea.styles';
|
|
4
4
|
import type { TextAreaProps } from './types';
|
|
@@ -156,7 +156,7 @@ const TextArea = forwardRef<IdealystElement, TextAreaProps>(({
|
|
|
156
156
|
const helperTextProps = getWebProps([helperTextStyleComputed]);
|
|
157
157
|
const characterCountProps = getWebProps([characterCountStyleComputed]);
|
|
158
158
|
|
|
159
|
-
const adjustHeight = () => {
|
|
159
|
+
const adjustHeight = useCallback(() => {
|
|
160
160
|
if (!autoGrow || !textareaRef.current) return;
|
|
161
161
|
|
|
162
162
|
const textarea = textareaRef.current;
|
|
@@ -175,11 +175,11 @@ const TextArea = forwardRef<IdealystElement, TextAreaProps>(({
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
textarea.style.height = `${newHeight}px`;
|
|
178
|
-
};
|
|
178
|
+
}, [autoGrow, minHeight, maxHeight]);
|
|
179
179
|
|
|
180
180
|
useEffect(() => {
|
|
181
181
|
adjustHeight();
|
|
182
|
-
}, [value,
|
|
182
|
+
}, [value, adjustHeight]);
|
|
183
183
|
|
|
184
184
|
const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
|
|
185
185
|
e.stopPropagation();
|