Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix multiline detection to respect minLines-only call sites

AmanRajSinghMouryac6a7f0648a20
diff --git a/mobile/apps/photos/lib/ui/components/text_input_widget_v2.dart b/mobile/apps/photos/lib/ui/components/text_input_widget_v2.dart
index b1ab4ab7f5..e758eaaadf 100644
--- a/mobile/apps/photos/lib/ui/components/text_input_widget_v2.dart
+++ b/mobile/apps/photos/lib/ui/components/text_input_widget_v2.dart
@@ -266,7 +266,9 @@ class _TextInputWidgetV2State extends State<TextInputWidgetV2>
widget.shouldSurfaceExecutionStates;
bool get _isMultiline =>
- !widget.isPasswordInput && (widget.maxLines ?? 1) > 1;
+ !widget.isPasswordInput &&
+ ((widget.maxLines != null && widget.maxLines! > 1) ||
+ (widget.minLines != null && widget.minLines! > 1));
@override
Widget build(BuildContext context) {
@@ -346,8 +348,8 @@ class _TextInputWidgetV2State extends State<TextInputWidgetV2>
textCapitalization: widget.textCapitalization!,
autofocus: widget.autoFocus ?? false,
autocorrect: widget.autoCorrect,
- maxLines: widget.isPasswordInput ? 1 : (widget.maxLines ?? 1),
- minLines: widget.isPasswordInput ? null : widget.minLines,
+ maxLines: widget.maxLines ?? (_isMultiline ? null : 1),
+ minLines: widget.minLines,
autofillHints: widget.autofillHints ??
(widget.isPasswordInput
? const [AutofillHints.password]