Repository navigation
Unexpected Aligment in SelectionArea on Flutter Web #148934
Description
Activity
- addedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on May 23, 2024 Thanks for your report. I can reproduce the same on Web. On some other platforms (macOS desktop app, iOS and Android), the Text wrapped by SelectionArea is aligned to the left.
Web macOS app 

flutter doctor -v (stable and master)
[✓] Flutter (Channel stable, 3.22.1, on macOS 14.1 23B74 darwin-x64, locale en-VN) • Flutter version 3.22.1 on channel stable at /Users/huynq/Documents/GitHub/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision a14f74ff3a (11 hours ago), 2024-05-22 11:08:21 -0500 • Engine revision 55eae6864b • Dart version 3.4.1 • DevTools version 2.34.3 [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/huynq/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • ANDROID_HOME = /Users/huynq/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.3) • Xcode at /Applications/Xcode15.3.app/Contents/Developer • Build 15E204a • CocoaPods version 1.15.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2023.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • android-studio-dir = /Applications/Android Studio.app/ • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874) [✓] VS Code (version 1.89.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.88.0 [✓] Connected device (2 available) • macOS (desktop) • macos • darwin-x64 • macOS 14.1 23B74 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 125.0.6422.76 [✓] Network resources • All expected network resources are available. • No issues found![!] Flutter (Channel master, 3.22.0-44.0.pre.10, on macOS 14.1 23B74 darwin-x64, locale en-VN) • Flutter version 3.22.0-44.0.pre.10 on channel master at /Users/huynq/Documents/GitHub/flutter_master ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path. ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path. • Upstream repository https://github.com/flutter/flutter.git • Framework revision fe0932f2c0 (76 minutes ago), 2024-05-22 22:19:25 -0400 • Engine revision b8b82454e3 • Dart version 3.5.0 (build 3.5.0-178.0.dev) • DevTools version 2.36.0-dev.10 • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades. [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/huynq/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • ANDROID_HOME = /Users/huynq/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.3) • Xcode at /Applications/Xcode15.3.app/Contents/Developer • Build 15E204a • CocoaPods version 1.15.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2023.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • android-studio-dir = /Applications/Android Studio.app/ • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874) [✓] VS Code (version 1.89.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.88.0 [✓] Connected device (2 available) • macOS (desktop) • macos • darwin-x64 • macOS 14.1 23B74 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 125.0.6422.76 [✓] Network resources • All expected network resources are available. ! Doctor found issues in 1 category.
Reacted by Yash Dhrangdhariya- addedframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.platform-webWeb applications specificallyWeb applications specificallyhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onf: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsteam-frameworkOwned by Framework teamOwned by Framework teamfound in release: 3.22Found to occur in 3.22Found to occur in 3.22and removedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on May 23, 2024 This line is responsible for the alignement on web:
flutter/packages/flutter/lib/src/widgets/_platform_selectable_region_context_menu_web.dart
Line 138 in c14d55c
alignment: Alignment.center, cc @chunhtai Do you know why we specified Alignment.center in the snippet above for context menus on the web?
- addedP2Important issues not at the top of the work listImportant issues not at the top of the work listtriaged-frameworkTriaged by Framework teamTriaged by Framework teamfyi-webFor the attention of Web platform teamFor the attention of Web platform team
on May 28, 2024 - removedfyi-webFor the attention of Web platform teamFor the attention of Web platform team
on May 30, 2024 This looks similar to #121053.
Reacted by HuyClosing this issue as a duplicate of #121053. Please feel free to re-open if that is not the case.
- addedr: duplicateIssue is closed as a duplicate of an existing issueIssue is closed as a duplicate of an existing issue
on Jun 14, 2024 - added a commit that references this issue
on Jun 21, 2024 - added a commit that references this issue
on Jun 26, 2024 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.- locked as resolved and limited conversation to collaborators
on Jun 28, 2024
Steps to reproduce
Expected results
Text alignment shouldn't be changed for only the text widget wrapped in SelectionArea.
Actual results
Text alignment is center for only the text widget wrapped in SelectionArea.
Code sample
Code sample
Screenshots or Video
Screenshots / Video demonstration
Flutter Doctor output
Doctor output