Skip to content

Commit 72ed68d

Browse files
committed
fix(TextArea): 修复onChange事件无效
1 parent 3c8077c commit 72ed68d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/core/src/TextArea/index.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function TextArea(props: TextAreaProps) {
5050
placeholder = '',
5151
placeholderTextColor = '#989FB2',
5252
numberOfLines = 30,
53-
onChange = () => {},
53+
onChange,
5454
maxLength = 50,
5555
value = '',
5656
editable = true,
@@ -87,13 +87,15 @@ function TextArea(props: TextAreaProps) {
8787
placeholderTextColor={placeholderTextColor}
8888
numberOfLines={numberOfLines}
8989
maxLength={maxLength}
90-
onChangeText={onChange}
90+
onChangeText={(value) => {
91+
onChange?.(value);
92+
}}
9193
onChange={onChangeValue}
9294
onContentSizeChange={onContentSizeChange}
9395
editable={editable}
9496
value={value}
9597
{...other}
96-
></TextInput>
98+
/>
9799
{showWords === true && <Text style={[styles.textWords, fontStyle]}>{value.length + '/' + maxLength}</Text>}
98100
</View>
99101
</View>

0 commit comments

Comments
 (0)