Skip to content

When ensureSemantics is On can't click on RadioListTile secondary item #177314

Closed as duplicate

Description

@bstatev-via

Steps to reproduce

  1. Run the application
  2. ensureSemantics is enable at the start
  3. Click on Open Dialog Button

Expected results

When you try to click on Open Dialog Button dialog is displayed

Actual results

You can't click on Open Dialog Button and instead RadioItem is selected

Code sample

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

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) => MaterialApp(
    title: 'Simple App',
    theme: ThemeData(
      primarySwatch: Colors.blue,
    ),
    home: const MyHomePage(),
  );
}

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

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

class _MyHomePageState extends State<MyHomePage> {
  String? _selectedValue;

  @override
  void initState() {
    super.initState();
    SemanticsBinding.instance.ensureSemantics();
  }

  void _showDialog(BuildContext context) {
    showDialog(
      context: context,
      builder: (context) => AlertDialog(
        title: const Text('Dialog Title'),
        content: const Text(
          'This is a simple dialog opened from the PlexCell button.',
        ),
        actions: [
          TextButton(
            onPressed: () {
              Navigator.of(context).pop();
            },
            child: const Text('Close'),
          ),
        ],
      ),
    );
  }

  void _showCellTapDialog(BuildContext context) {
    showDialog(
      context: context,
      builder: (context) => AlertDialog(
        title: const Text('Cell Tap Dialog'),
        content: const Text(
          'This dialog was opened by tapping on the PlexCell itself.',
        ),
        actions: [
          TextButton(
            onPressed: () {
              Navigator.of(context).pop();
            },
            child: const Text('Close'),
          ),
        ],
      ),
    );
  }

  @override
  Widget build(BuildContext context) => Scaffold(
    appBar: AppBar(
      title: const Text('RadioListTile Demo'),
    ),
    body: Padding(
      padding: const EdgeInsets.all(16.0),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          const Text(
            'Select an option:',
            style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
          ),
          const SizedBox(height: 16),
          Expanded(
            child: ListView(
              children: [
                RadioListTile<String>(
                  title: const Text('Sample Option 1'),
                  subtitle: const Text(
                    'This RadioListTile has a trailing button',
                  ),
                  value: 'option1',
                  groupValue: _selectedValue,
                  onChanged: (value) {
                    setState(() {
                      _selectedValue = value;
                    });
                  },
                  secondary: ElevatedButton(
                    onPressed: () => _showDialog(context),
                    child: const Text('Open Dialog'),
                  ),
                ),
                RadioListTile<String>(
                  title: const Text('Sample Option 2'),
                  subtitle: const Text(
                    'This RadioListTile opens a dialog on tap',
                  ),
                  value: 'option2',
                  groupValue: _selectedValue,
                  onChanged: (value) {
                    setState(() {
                      _selectedValue = value;
                    });
                  },
                ),
              ],
            ),
          ),
        ],
      ),
    ),
  );
}

Screenshots or Video

Screenshots / Video demonstration
Untitled.mov

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[Paste your output here]

Activity

  1. added
    in triagePresently being triaged by the triage team
    on Oct 22, 2025
  2. huycozy commented on Oct 22, 2025

    @huycozy
    Member

    Duplicate of #146063. Please follow that issue for updates.

  3. added
    r: duplicateIssue is closed as a duplicate of an existing issue
    and removed
    in triagePresently being triaged by the triage team
    on Oct 22, 2025
  4. github-actions commented on Nov 5, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  5. locked as resolved and limited conversation to collaborators on Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: duplicateIssue is closed as a duplicate of an existing issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions