Skip to content
Open
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
17 changes: 14 additions & 3 deletions tdesign-component/lib/src/components/input/input_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,31 +110,42 @@ class TInputView extends StatelessWidget {
this.onTapOutside,
this.selectionControls,
this.contextMenuBuilder,
this.enableInteractiveSelection})
this.enableInteractiveSelection,
this.onTap})
: super(
key: key,
);

/// 点击输入框回调
final GestureTapCallback? onTap;

@override
Widget build(BuildContext context) {
return TextField(
inputFormatters: inputFormatters,
readOnly: readOnly,
keyboardType: inputType,
keyboardType: inputType ?? (obscureText ? TextInputType.visiblePassword : null),
textInputAction: inputAction,
autofocus: autofocus,
obscureText: obscureText,
enableSuggestions: !obscureText,
autocorrect: !obscureText,
enableInteractiveSelection: enableInteractiveSelection,
onEditingComplete: onEditingComplete,
onSubmitted: onSubmitted,
controller: controller,
onChanged: onChanged,
focusNode: focusNode,
cursorColor: cursorColor,
maxLines: maxLines,
maxLines: obscureText ? 1 : maxLines,
minLines: minLines,
maxLength: maxLength,
onTapOutside: onTapOutside,
onTap: onTap ?? (obscureText ? () {
if (focusNode != null && focusNode!.hasFocus) {
SystemChannels.textInput.invokeMethod('TextInput.show');
}
} : null),
selectionControls: selectionControls,
contextMenuBuilder: contextMenuBuilder,
style: textStyle,
Expand Down
Loading