mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
feat:多行文本框支持change事件
This commit is contained in:
parent
00bcca021b
commit
1173a98d28
@ -104,6 +104,13 @@ export default class TextAreaControl extends React.Component<
|
||||
this.inputRef.current?.focus();
|
||||
}
|
||||
|
||||
@autobind
|
||||
@bindRendererEvent<TextAreaProps, TextAreaRendererEvent>('change')
|
||||
handleChange(e: React.ChangeEvent<HTMLTextAreaElement>) {
|
||||
const {onChange} = this.props;
|
||||
onChange && onChange(e);
|
||||
}
|
||||
|
||||
@autobind
|
||||
@bindRendererEvent<TextAreaProps, TextAreaRendererEvent>('focus')
|
||||
handleFocus(e: React.FocusEvent<HTMLTextAreaElement>) {
|
||||
@ -142,7 +149,7 @@ export default class TextAreaControl extends React.Component<
|
||||
const {...rest} = this.props;
|
||||
|
||||
return (
|
||||
<Textarea {...rest} onFocus={this.handleFocus} onBlur={this.handleBlur} />
|
||||
<Textarea {...rest} onFocus={this.handleFocus} onBlur={this.handleBlur} onChange={this.handleChange} />
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user