Skip to content

TextInputConnection when using external keyboard interferes with widget focus using Enter/Space #168099

@Renzo-Olivares

Description

@Renzo-Olivares

Steps to reproduce

  1. Press tab key until reaching TextField or tap on TextField to establish a text input connection.
  2. Press tab key until reaching "Radio Option 3".
  3. Press space or enter to select a "Radio Option 3".

Expected results

Radio Option 3 is selected.

Actual results

Radio button selection does not change. On-screen keyboard suggestions pop up at bottom of screen.

Code sample

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

// Main application widget
class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      ),
      home: const MyHomePage(),
      debugShowCheckedModeBanner: false,
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final TextEditingController _textController = TextEditingController();
  int? _radioValue = 1;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: ListView(
          children: <Widget>[
            const SizedBox(height: 8),
            TextField(
              controller: _textController,
              decoration: const InputDecoration(
                border: OutlineInputBorder(),
                labelText: 'Enter text',
                hintText: 'Type something here',
                prefixIcon: Icon(Icons.edit),
              ),
            ),
            const SizedBox(height: 20),
            Column(
              children: <Widget>[
                RadioListTile<int>(
                  title: const Text('Radio Option 1'),
                  value: 1,
                  groupValue: _radioValue,
                  onChanged: (int? value) {
                    setState(() {
                      _radioValue = value;
                    });
                  },
                ),
                RadioListTile<int>(
                  title: const Text('Radio Option 2'),
                  value: 2,
                  groupValue: _radioValue,
                  onChanged: (int? value) {
                    setState(() {
                      _radioValue = value;
                    });
                  },
                ),
                 RadioListTile<int>(
                  title: const Text('Radio Option 3'),
                  value: 3,
                  groupValue: _radioValue,
                  onChanged: (int? value) {
                    setState(() {
                      _radioValue = value;
                    });
                  },
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }

  @override
  void dispose() {
    _textController.dispose();
    super.dispose();
  }
}

Screenshots or Video

Screenshots / Video demonstration
Screen_Recording_20250430_132927.mp4

Reproduced On

  • Samsung Galaxy S10 Tablet

Metadata

Metadata

Labels

P2Important issues not at the top of the work liste: device-specificOnly manifests on certain devicesteam-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions