Skip to content

TDSearchBar:输入框添加onTapOutside参数支持 #608

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

Merged
merged 1 commit into from
May 30, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class TDSearchBar extends StatefulWidget {
this.onTextChanged,
this.onSubmitted,
this.onEditComplete,
this.onTapOutside,
this.onInputClick,
this.autoHeight = false,
this.padding = const EdgeInsets.fromLTRB(16, 8, 16, 8),
Expand Down Expand Up @@ -93,6 +94,9 @@ class TDSearchBar extends StatefulWidget {
/// 编辑完成回调
final TDSearchBarCallBack? onEditComplete;

// 点击输入框外部回调
final TapRegionCallback? onTapOutside;

/// 自定义操作文字
final String action;

Expand Down Expand Up @@ -246,6 +250,7 @@ class _TDSearchBarState extends State<TDSearchBar>
onChanged: widget.onTextChanged,
onSubmitted: widget.onSubmitted,
onEditingComplete: widget.onEditComplete,
onTapOutside: widget.onTapOutside,
style: TextStyle(
textBaseline: TextBaseline.ideographic,
fontSize: getSize(context)?.size,
Expand Down