Skip to content

Semantics of elements are not same in listview and Column #160512

@lsaudon

Description

@lsaudon

Steps to reproduce

  1. Paste in a DartPad

Expected results

The rendering of Column should be the same whether it's in a ListView or a Column.

image

Actual results

Column are rendered differently in ListView and Column.

I don't know how to explain it.
Items in the column appear merged when in a list.

image

Code sample

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      showSemanticsDebugger: true,
      home: Scaffold(
        body: SafeArea(
          child: Column(
            children: [
              SizedBox(
                height: 100,
                child: ListView(
                  children: [_MyWidget()],
                ),
              ),
              Column(
                mainAxisSize: MainAxisSize.min,
                children: [_MyWidget()],
              ),
            ],
          ),
        ),
      ),
    );
  }
}

class _MyWidget extends StatelessWidget {
  const _MyWidget();

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Text('Hello, World!'),
        ElevatedButton(
          onPressed: () {},
          child: Text("Button"),
        ),
      ],
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs

https://pastebin.com/qWntn72P

Flutter Doctor output

Doctor output
Based on Dart SDK 3.7.0-243.0.dev and Flutter SDK 3.28.0-1.0.pre.104

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)found in release: 3.27Found to occur in 3.27found in release: 3.28Found to occur in 3.28frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)triaged-accessibilityTriaged by Framework Accessibility team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions