Repository navigation
Semantics is misaligned with actual component on web #171264
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 3.32Found to occur in 3.32Found to occur in 3.32found in release: 3.33Found to occur in 3.33Found to occur in 3.33frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)Owned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)triaged-accessibilityTriaged by Framework Accessibility teamTriaged by Framework Accessibility team
Description
Steps to reproduce
- Enable semantics in flutter web
- Add any long data table with many items to enable scrolling
- Start to scroll fast
Expected results
Semantics nodes are correctly aligned with the items
Actual results
- First row of the datatable is always misaligned whether scrolling or not
=> Remove dataRowMinHeight will fix this problem, but I want to be able to set this value - When scrolling fast, semantics nodes are misaligned with the items
Code sample
import 'package:flutter/material.dart';
import 'package:flutter/semantics.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
SemanticsBinding.instance.ensureSemantics();
runApp(const MyApp());
}
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: DataTableScreen(),
);
}
}
class DataTableScreen extends StatelessWidget {
final List<Map<String, dynamic>> users = [
{'name': 'Alice', 'age': 30, 'email': '[email protected]'},
{'name': 'Bob', 'age': 25, 'email': '[email protected]'},
{'name': 'Charlie', 'age': 35, 'email': '[email protected]'},
{'name': 'Alice', 'age': 30, 'email': '[email protected]'},
{'name': 'Bob', 'age': 25, 'email': '[email protected]'},
{'name': 'Charlie', 'age': 35, 'email': '[email protected]'},
{'name': 'Alice', 'age': 30, 'email': '[email protected]'},
{'name': 'Bob', 'age': 25, 'email': '[email protected]'},
{'name': 'Charlie', 'age': 35, 'email': '[email protected]'},
{'name': 'Alice', 'age': 30, 'email': '[email protected]'},
{'name': 'Bob', 'age': 25, 'email': '[email protected]'},
{'name': 'Charlie', 'age': 35, 'email': '[email protected]'},
{'name': 'Alice', 'age': 30, 'email': '[email protected]'},
{'name': 'Bob', 'age': 25, 'email': '[email protected]'},
{'name': 'Charlie', 'age': 35, 'email': '[email protected]'},
{'name': 'Alice', 'age': 30, 'email': '[email protected]'},
{'name': 'Bob', 'age': 25, 'email': '[email protected]'},
{'name': 'Charlie', 'age': 35, 'email': '[email protected]'},
{'name': 'Alice', 'age': 30, 'email': '[email protected]'},
{'name': 'Bob', 'age': 25, 'email': '[email protected]'},
{'name': 'Charlie', 'age': 35, 'email': '[email protected]'},
{'name': 'Alice', 'age': 30, 'email': '[email protected]'},
{'name': 'Bob', 'age': 25, 'email': '[email protected]'},
{'name': 'Charlie', 'age': 35, 'email': '[email protected]'},
{'name': 'Alice', 'age': 30, 'email': '[email protected]'},
{'name': 'Bob', 'age': 25, 'email': '[email protected]'},
{'name': 'Charlie', 'age': 35, 'email': '[email protected]'},
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('User Data Table')),
body: SingleChildScrollView(
padding: EdgeInsets.all(16.0),
scrollDirection: Axis.vertical,
child: DataTable(
dataRowMaxHeight: double.infinity,
dataRowMinHeight: 70,
showCheckboxColumn: false,
columns: const [
DataColumn(label: Text('Name')),
DataColumn(label: Text('Age')),
DataColumn(label: Text('Email')),
],
rows: users
.map(
(user) => DataRow(
cells: [
DataCell(
onTap: () => print(user['name']),
Text(user['name']),
),
DataCell(Text(user['age'].toString())),
DataCell(Text(user['email'])),
],
),
)
.toList(),
),
),
);
}
}
Screenshots or Video
Screen.Recording.2025-06-27.at.10.58.12.mov
Screenshots / Video demonstration
[Upload media here]
Flutter Doctor output
Doctor output
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.32.4, on macOS 14.6.1 23G93 darwin-arm64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.101.1)
[✓] Connected device (3 available)
[✓] Network resources
• No issues found!```
</details>Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 3.32Found to occur in 3.32Found to occur in 3.32found in release: 3.33Found to occur in 3.33Found to occur in 3.33frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)Owned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)triaged-accessibilityTriaged by Framework Accessibility teamTriaged by Framework Accessibility team
Type
Projects
- StatusShow more project fieldsDone
Activity
darshankawar commentedon Jun 30, 2025
Thanks for the report. I was able to replicate the reported behavior with latest sdk versions.
[-]Semantics is misaligned with actual component[/-][+]Semantics is misaligned with actual component on web[/+]mdebbar commentedon Jul 14, 2025
The cells of the first row have a
transformwith aycomponent that's non zero for some reason. Since the cell has the same vertical position as the row it belongs to, theycomponent of the cell should be zero.Cells of other rows are fine; their transforms have a zero
ycomponent.These transforms are sent from the framework during semantics updates, so this is most likely a framework issue.
4 remaining items
Fix table cell semantics rect alignment issues. (#174914)
Fix table cell semantics rect alignment issues. (flutter#174914)
github-actions commentedon Sep 19, 2025
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 -vand a minimal reproduction of the issue.Fix table cell semantics rect alignment issues. (flutter#174914)
Fix table cell semantics rect alignment issues. (flutter#174914)
Fix table cell semantics rect alignment issues. (#174914)
Fix table cell semantics rect alignment issues. (#174914)