From 49b534d14582cd28994547cd609ff2921808ae75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malo=20L=C3=A9on?= Date: Tue, 21 Feb 2023 18:44:11 +0100 Subject: [PATCH] fix(ui_kit): fix tab action focus on textinputs --- .../lib/src/components/text_inputs/text_input_screen.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/wyatt_ui_kit/lib/src/components/text_inputs/text_input_screen.dart b/packages/wyatt_ui_kit/lib/src/components/text_inputs/text_input_screen.dart index 34836c2d..440fc748 100644 --- a/packages/wyatt_ui_kit/lib/src/components/text_inputs/text_input_screen.dart +++ b/packages/wyatt_ui_kit/lib/src/components/text_inputs/text_input_screen.dart @@ -250,9 +250,11 @@ class TextInputScreen extends CubitScreen { Widget onBuild(BuildContext context, TextInputState state) { final style = _resolve(context, state); return Focus( + descendantsAreFocusable: true, onFocusChange: (hasFocus) { if (hasFocus) { bloc(context).onFocus(); + (focusNode ?? _focusNode).requestFocus(); } else { bloc(context).onUnfocus(); } @@ -279,6 +281,7 @@ class TextInputScreen extends CubitScreen { expand: expand ?? true, expanded: _wrapperExpanded(state), child: TextField( + focusNode: focusNode ?? _focusNode, onTap: onTap, onChanged: (value) { onChanged?.call(value); @@ -290,7 +293,6 @@ class TextInputScreen extends CubitScreen { }, onTapOutside: onTapOutside, controller: controller ?? _controller, - focusNode: focusNode ?? _focusNode, textAlignVertical: textAlignVertical ?? TextAlignVertical.top, style: style.inputStyle ?? this.style, decoration: InputDecoration( -- 2.47.2