mirror of
https://github.com/R0m1k3/xtremobile.git
synced 2026-10-11 17:29:26 +02:00
v1.1.10: Fix keyboard opening on navigation in Android TV
- Added ExcludeFocus and readOnly: !_isEditing to _TVTextField - Prevents keyboard from opening during D-pad navigation - Ensures keyboard only opens when strictly intended by _activateInput
This commit is contained in:
1 parent
b93b25b130
commit
cd2e4df2a8
2 files changed
+22
-18
No files matched your search
@@ -626,23 +626,26 @@ class _TVTextFieldState extends State<_TVTextField> {
|
||||
border: isFocused ? Border.all(color: AppColors.primary, width: 2) : null,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: TextField(
|
||||
controller: widget.controller,
|
||||
focusNode: _inputFocus,
|
||||
obscureText: widget.obscureText,
|
||||
keyboardType: widget.keyboardType,
|
||||
textInputAction: widget.textAction,
|
||||
onSubmitted: (_) {
|
||||
setState(() => _isEditing = false);
|
||||
// Give focus back to nav node first so we can move to next
|
||||
_navFocus.requestFocus();
|
||||
widget.onSubmitted?.call();
|
||||
},
|
||||
style: const TextStyle(color: AppColors.textPrimary),
|
||||
// Important: Disable standard focus behavior to prevent keyboard popup
|
||||
// unless we explicitly requested it via _activateInput
|
||||
canRequestFocus: _isEditing,
|
||||
decoration: InputDecoration(
|
||||
// Ignore standard focus traversal to child, only allow programatic focus
|
||||
child: ExcludeFocus(
|
||||
excluding: !_isEditing,
|
||||
child: TextField(
|
||||
controller: widget.controller,
|
||||
focusNode: _inputFocus,
|
||||
// Prevent keyboard if somehow focused while not editing
|
||||
readOnly: !_isEditing,
|
||||
showCursor: _isEditing,
|
||||
obscureText: widget.obscureText,
|
||||
keyboardType: widget.keyboardType,
|
||||
textInputAction: widget.textAction,
|
||||
onSubmitted: (_) {
|
||||
setState(() => _isEditing = false);
|
||||
// Give focus back to nav node first so we can move to next
|
||||
_navFocus.requestFocus();
|
||||
widget.onSubmitted?.call();
|
||||
},
|
||||
style: const TextStyle(color: AppColors.textPrimary),
|
||||
decoration: InputDecoration(
|
||||
labelText: widget.label,
|
||||
hintText: widget.hint,
|
||||
prefixIcon: Icon(widget.icon, color: isFocused ? AppColors.primary : AppColors.textSecondary),
|
||||
@@ -658,6 +661,7 @@ class _TVTextFieldState extends State<_TVTextField> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
|
||||
@@ -108,7 +108,7 @@ class _MobileSettingsTabState extends ConsumerState<MobileSettingsTab> {
|
||||
),
|
||||
SizedBox(height: 4),
|
||||
Text(
|
||||
'Version 1.1.9',
|
||||
'Version 1.1.10',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: AppColors.textSecondary,
|
||||
|
||||
Reference in new issue
Block a user