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,
|
border: isFocused ? Border.all(color: AppColors.primary, width: 2) : null,
|
||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(4),
|
||||||
),
|
),
|
||||||
child: TextField(
|
// Ignore standard focus traversal to child, only allow programatic focus
|
||||||
controller: widget.controller,
|
child: ExcludeFocus(
|
||||||
focusNode: _inputFocus,
|
excluding: !_isEditing,
|
||||||
obscureText: widget.obscureText,
|
child: TextField(
|
||||||
keyboardType: widget.keyboardType,
|
controller: widget.controller,
|
||||||
textInputAction: widget.textAction,
|
focusNode: _inputFocus,
|
||||||
onSubmitted: (_) {
|
// Prevent keyboard if somehow focused while not editing
|
||||||
setState(() => _isEditing = false);
|
readOnly: !_isEditing,
|
||||||
// Give focus back to nav node first so we can move to next
|
showCursor: _isEditing,
|
||||||
_navFocus.requestFocus();
|
obscureText: widget.obscureText,
|
||||||
widget.onSubmitted?.call();
|
keyboardType: widget.keyboardType,
|
||||||
},
|
textInputAction: widget.textAction,
|
||||||
style: const TextStyle(color: AppColors.textPrimary),
|
onSubmitted: (_) {
|
||||||
// Important: Disable standard focus behavior to prevent keyboard popup
|
setState(() => _isEditing = false);
|
||||||
// unless we explicitly requested it via _activateInput
|
// Give focus back to nav node first so we can move to next
|
||||||
canRequestFocus: _isEditing,
|
_navFocus.requestFocus();
|
||||||
decoration: InputDecoration(
|
widget.onSubmitted?.call();
|
||||||
|
},
|
||||||
|
style: const TextStyle(color: AppColors.textPrimary),
|
||||||
|
decoration: InputDecoration(
|
||||||
labelText: widget.label,
|
labelText: widget.label,
|
||||||
hintText: widget.hint,
|
hintText: widget.hint,
|
||||||
prefixIcon: Icon(widget.icon, color: isFocused ? AppColors.primary : AppColors.textSecondary),
|
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),
|
SizedBox(height: 4),
|
||||||
Text(
|
Text(
|
||||||
'Version 1.1.9',
|
'Version 1.1.10',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
color: AppColors.textSecondary,
|
color: AppColors.textSecondary,
|
||||||
|
|||||||
Reference in new issue
Block a user