Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

优化字数限制变化更新 #385

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions tdesign-component/example/lib/page/td_textarea_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ class _TDTextareaPageState extends State<TDTextareaPage> {
maxLines: 4,
minLines: 4,
onChanged: (value) {
setState(() {});
},
);
}
Expand All @@ -110,7 +109,6 @@ class _TDTextareaPageState extends State<TDTextareaPage> {
hintText: '请输入文字',
minLines: 1,
onChanged: (value) {
setState(() {});
},
);
}
Expand All @@ -126,7 +124,6 @@ class _TDTextareaPageState extends State<TDTextareaPage> {
maxLength: 500,
indicator: true,
onChanged: (value) {
setState(() {});
},
);
}
Expand All @@ -141,7 +138,7 @@ class _TDTextareaPageState extends State<TDTextareaPage> {
minLines: 4,
readOnly: true,
onChanged: (value) {
setState(() {});

},
);
}
Expand All @@ -158,7 +155,6 @@ class _TDTextareaPageState extends State<TDTextareaPage> {
indicator: true,
layout: TDTextareaLayout.vertical,
onChanged: (value) {
setState(() {});
},
);
}
Expand All @@ -179,7 +175,6 @@ class _TDTextareaPageState extends State<TDTextareaPage> {
),
margin: EdgeInsets.only(right: TDTheme.of(context).spacer16, left: TDTheme.of(context).spacer16),
onChanged: (value) {
setState(() {});
},
);
}
Expand All @@ -197,7 +192,6 @@ class _TDTextareaPageState extends State<TDTextareaPage> {
layout: TDTextareaLayout.vertical,
bordered: true,
onChanged: (value) {
setState(() {});
},
);
}
Expand All @@ -214,7 +208,6 @@ class _TDTextareaPageState extends State<TDTextareaPage> {
indicator: true,
width: 200,
onChanged: (value) {
setState(() {});
},
);
}
Expand All @@ -236,7 +229,6 @@ class _TDTextareaPageState extends State<TDTextareaPage> {
maxLength: 500,
indicator: true,
onChanged: (value) {
setState(() {});
},
);
}
Expand All @@ -255,7 +247,6 @@ class _TDTextareaPageState extends State<TDTextareaPage> {
required: true,
additionInfo: '辅助说明',
onChanged: (value) {
setState(() {});
},
);
}
Expand All @@ -273,7 +264,6 @@ class _TDTextareaPageState extends State<TDTextareaPage> {
layout: TDTextareaLayout.vertical,
size: TDInputSize.small,
onChanged: (value) {
setState(() {});
},
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,13 @@ class _TDTextareaState extends State<TDTextarea> {
hintText: widget.hintText,
inputType: widget.inputType,
textAlign: widget.textAlign,
onChanged: widget.onChanged,
onChanged:(val){
setState(() {
});
if(widget.onChanged!=null){
widget.onChanged!(val);
}
},
inputFormatters: [
...(widget.inputFormatters ?? []),
...(widget.maxLength != null && !(widget.allowInputOverMax ?? false)
Expand Down