Refactor autofocus logic in login dialogs for better platform handling

This commit is contained in:
Winston Lowe
2026-01-26 10:40:10 -08:00
parent 749f9d4dfd
commit 898ef1c11c
3 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ class RepeaterHubScreen extends StatelessWidget {
),
const SizedBox(height: 8),
Text(
'$repeater.shortPubKeyHex',
repeater.shortPubKeyHex,
style: TextStyle(fontSize: 14, color: Colors.grey[600]),
),
const SizedBox(height: 8),
+3 -1
View File
@@ -322,7 +322,9 @@ class _RepeaterLoginDialogState extends State<RepeaterLoginDialog> {
}
},
onSubmitted: (_) => _handleLogin(),
autofocus: _passwordController.text.isEmpty,
autofocus: !(defaultTargetPlatform == TargetPlatform.android ||
defaultTargetPlatform == TargetPlatform.iOS) &&
_passwordController.text.isEmpty,
),
const SizedBox(height: 12),
CheckboxListTile(
+3 -1
View File
@@ -293,7 +293,9 @@ class _RoomLoginDialogState extends State<RoomLoginDialog> {
),
),
onSubmitted: (_) => _handleLogin(),
//autofocus: _passwordController.text.isEmpty,
autofocus: !(defaultTargetPlatform == TargetPlatform.android ||
defaultTargetPlatform == TargetPlatform.iOS) &&
_passwordController.text.isEmpty,
),
const SizedBox(height: 12),
CheckboxListTile(