flutter / flutter/flutter

Semantics of elements are not same in listview and Column

Open
#160,512 3 comments 0 reactions 0 assignees View on GitHub
a: accessibility found in release: 3.27 found in release: 3.28 framework has reproducible steps P3 team-accessibility triaged-accessibility
Dominant language
Dart
Stars
179k
Forks
31.1k
PR merge metrics
PR metrics pending

Description

### 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

```dart
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

```console
Based on Dart SDK 3.7.0-243.0.dev and Flutter SDK 3.28.0-1.0.pre.104
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.