Skip to content

armgit / ente

Public Imported from GitHub
0

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

Merge branch 'main' into locker-component-cleanup

aman-pilot0266d5769ef1
diff --cc mobile/packages/ente_components/lib/components/text_input_component.dart
index eea93b58b7,830498ad61..3a9865df79
--- a/mobile/packages/ente_components/lib/components/text_input_component.dart
+++ b/mobile/packages/ente_components/lib/components/text_input_component.dart
@@@ -234,93 -250,95 +252,97 @@@ class _TextInputComponentState extends
),
const SizedBox(height: Spacing.sm),
],
- GestureDetector(
- behavior: HitTestBehavior.opaque,
- onTap: widget.isDisabled ? null : _focusNode.requestFocus,
- child: Container(
- height: _isMultiline ? null : _kHeight,
- constraints: _isMultiline
- ? const BoxConstraints(minHeight: _kHeight)
- : null,
- decoration: BoxDecoration(
- color: _backgroundColor(colors),
- borderRadius: BorderRadius.circular(Radii.lg),
- border: Border.all(color: _borderColor(colors)),
- ),
- child: Stack(
- clipBehavior: Clip.none,
- fit: _isMultiline ? StackFit.loose : StackFit.expand,
- children: [
- Padding(
- padding: EdgeInsets.symmetric(
- horizontal: Spacing.lg,
- vertical: _isMultiline ? Spacing.lg : 0,
- ),
- child: Row(
- crossAxisAlignment: _isMultiline
- ? CrossAxisAlignment.start
- : CrossAxisAlignment.center,
- children: [
- if (prefix != null) ...[
- prefix,
- const SizedBox(width: Spacing.sm),
- ],
- Expanded(
- child: TextField(
- controller: _controller,
- focusNode: _focusNode,
- enabled: !widget.isDisabled,
- autofocus: widget.autofocus,
- obscureText: _obscureText,
- maxLines: widget.isPasswordInput
- ? 1
- : widget.maxLines ?? (_isMultiline ? null : 1),
- minLines: widget.isPasswordInput
- ? null
- : widget.minLines,
- keyboardType: widget.keyboardType,
- textCapitalization: widget.textCapitalization,
- inputFormatters: _inputFormatters,
- autofillHints:
- widget.autofillHints ??
- (widget.isPasswordInput
- ? const [AutofillHints.password]
- : const []),
- autocorrect:
- widget.autocorrect && !widget.isPasswordInput,
- enableSuggestions:
- widget.enableSuggestions &&
- !widget.isPasswordInput,
- textAlignVertical: _isMultiline
- ? TextAlignVertical.top
- : TextAlignVertical.center,
- onEditingComplete: _handleEditingComplete,
- style: TextStyles.body.copyWith(
- color: _textColor(colors),
- ),
- decoration: InputDecoration(
- hintText: widget.hintText,
- hintStyle: TextStyles.body.copyWith(
- color: _hintColor(colors),
+ TextFieldTapRegion(
+ groupId: _groupId,
+ child: GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: widget.isDisabled ? null : _focusNode.requestFocus,
+ child: Container(
+ height: _isMultiline ? null : _kHeight,
+ constraints: _isMultiline
+ ? const BoxConstraints(minHeight: _kHeight)
+ : null,
+ decoration: BoxDecoration(
+ color: _backgroundColor(colors),
+ borderRadius: BorderRadius.circular(Radii.lg),
+ border: Border.all(color: _borderColor(colors)),
+ ),
+ child: Stack(
+ clipBehavior: Clip.none,
+ fit: _isMultiline ? StackFit.loose : StackFit.expand,
+ children: [
+ Padding(
+ padding: EdgeInsets.symmetric(
+ horizontal: Spacing.lg,
+ vertical: _isMultiline ? Spacing.lg : 0,
+ ),
+ child: Row(
+ crossAxisAlignment: _isMultiline
+ ? CrossAxisAlignment.start
+ : CrossAxisAlignment.center,
+ children: [
+ if (prefix != null) ...[
+ prefix,
+ const SizedBox(width: Spacing.sm),
+ ],
+ Expanded(
+ child: TextField(
+ controller: _controller,
+ focusNode: _focusNode,
+ enabled: !widget.isDisabled,
+ autofocus: widget.autofocus,
+ obscureText: _obscureText,
+ maxLines: widget.isPasswordInput
+ ? 1
+ : widget.maxLines ?? (_isMultiline ? null : 1),
+ minLines: widget.isPasswordInput
+ ? null
+ : widget.minLines,
+ keyboardType: widget.keyboardType,
+ textCapitalization: widget.textCapitalization,
+ inputFormatters: _inputFormatters,
+ autofillHints:
+ widget.autofillHints ??
+ (widget.isPasswordInput
+ ? const [AutofillHints.password]
+ : const []),
+ autocorrect:
+ widget.autocorrect && !widget.isPasswordInput,
- enableSuggestions: !widget.isPasswordInput,
++ enableSuggestions:
++ widget.enableSuggestions &&
++ !widget.isPasswordInput,
+ textAlignVertical: _isMultiline
+ ? TextAlignVertical.top
+ : TextAlignVertical.center,
+ onEditingComplete: _handleEditingComplete,
+ onTapOutside: (_) => _focusNode.unfocus(),
+ style: TextStyles.body.copyWith(
+ color: _textColor(colors),
+ ),
+ decoration: InputDecoration(
+ hintText: widget.hintText,
+ hintStyle: TextStyles.body.copyWith(
+ color: _hintColor(colors),
+ ),
+ border: InputBorder.none,
+ focusedBorder: InputBorder.none,
+ enabledBorder: InputBorder.none,
+ disabledBorder: InputBorder.none,
+ isDense: true,
+ contentPadding: EdgeInsets.zero,
),
- border: InputBorder.none,
- focusedBorder: InputBorder.none,
- enabledBorder: InputBorder.none,
- disabledBorder: InputBorder.none,
- isDense: true,
- contentPadding: EdgeInsets.zero,
),
),
- ),
- if (suffix != null) ...[
- const SizedBox(width: Spacing.sm),
- suffix,
+ if (suffix != null) ...[
+ const SizedBox(width: Spacing.sm),
+ suffix,
+ ],
],
- ],
+ ),
),
- ),
- if (suffixTap != null) _suffixTapTarget(suffixTap),
- ],
+ if (suffixTap != null) _suffixTapTarget(suffixTap),
+ ],
+ ),
),
),
),