-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Fix Selected DropdownMenuItem isn't highlighted on mobile #167874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Selected DropdownMenuItem isn't highlighted on mobile #167874
Conversation
37c4ec1 to
b95a68a
Compare
b95a68a to
a06e8fa
Compare
bleroux
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM to trigger Google tests
4702e1a to
3416529
Compare
justinmc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Sorry I missed this PR for so long!
|
The Google tests did complete and there were failures, but they are all expected. Something might be wrong with the infrastructure since I don't see it turning green. @huycozy If it still says "pending" on Monday then maybe push another rebase and ping me? |
Signed-off-by: huycozy <[email protected]>
3416529 to
d2c6df3
Compare
flutter/flutter@992ad74...54de32d 2025-05-12 [email protected] Update hello_world example to current layout flutter create uses (flutter/flutter#168571) 2025-05-12 [email protected] Roll Skia from cb1646ca59db to 9f9e1f37917e (1 revision) (flutter/flutter#168656) 2025-05-12 [email protected] Fix Selected DropdownMenuItem isn't highlighted on mobile (flutter/flutter#167874) 2025-05-12 [email protected] Api docs: Add Widget of the Week video to DropdownMenu (flutter/flutter#168254) 2025-05-12 [email protected] Bumping Framework Default TargetSdk to 36 (flutter/flutter#168577) 2025-05-11 [email protected] Roll Fuchsia Linux SDK from VIG5-P9wwXgQkCkeX... to 6vjKe0bfYDVaECqBL... (flutter/flutter#168646) 2025-05-11 [email protected] Roll Skia from 0feee17aeaca to cb1646ca59db (1 revision) (flutter/flutter#168642) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…#9243) flutter/flutter@992ad74...54de32d 2025-05-12 [email protected] Update hello_world example to current layout flutter create uses (flutter/flutter#168571) 2025-05-12 [email protected] Roll Skia from cb1646ca59db to 9f9e1f37917e (1 revision) (flutter/flutter#168656) 2025-05-12 [email protected] Fix Selected DropdownMenuItem isn't highlighted on mobile (flutter/flutter#167874) 2025-05-12 [email protected] Api docs: Add Widget of the Week video to DropdownMenu (flutter/flutter#168254) 2025-05-12 [email protected] Bumping Framework Default TargetSdk to 36 (flutter/flutter#168577) 2025-05-11 [email protected] Roll Fuchsia Linux SDK from VIG5-P9wwXgQkCkeX... to 6vjKe0bfYDVaECqBL... (flutter/flutter#168646) 2025-05-11 [email protected] Roll Skia from 0feee17aeaca to cb1646ca59db (1 revision) (flutter/flutter#168642) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…#9243) flutter/flutter@992ad74...54de32d 2025-05-12 [email protected] Update hello_world example to current layout flutter create uses (flutter/flutter#168571) 2025-05-12 [email protected] Roll Skia from cb1646ca59db to 9f9e1f37917e (1 revision) (flutter/flutter#168656) 2025-05-12 [email protected] Fix Selected DropdownMenuItem isn't highlighted on mobile (flutter/flutter#167874) 2025-05-12 [email protected] Api docs: Add Widget of the Week video to DropdownMenu (flutter/flutter#168254) 2025-05-12 [email protected] Bumping Framework Default TargetSdk to 36 (flutter/flutter#168577) 2025-05-11 [email protected] Roll Fuchsia Linux SDK from VIG5-P9wwXgQkCkeX... to 6vjKe0bfYDVaECqBL... (flutter/flutter#168646) 2025-05-11 [email protected] Roll Skia from 0feee17aeaca to cb1646ca59db (1 revision) (flutter/flutter#168642) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Fix #70294
Description
The bug is about the previously selected DropdownMenuItem isn't highlighted on mobile while it works on Web and desktop. The reason is that
FocusManager.instance.highlightModehas fallen toFocusHighlightMode.touchon mobile by default (or touch device without mouse in general):flutter/packages/flutter/lib/src/material/dropdown.dart
Lines 172 to 175 in 6f220d3
flutter/packages/flutter/lib/src/widgets/focus_manager.dart
Lines 2335 to 2353 in 7d56be4
flutter/packages/flutter/lib/src/widgets/focus_manager.dart
Lines 1741 to 1748 in 7d56be4
We actually can work around this by setting
FocusManager.instance.highlightStrategytoFocusHighlightStrategy.alwaysTraditional, see #70442 (comment). Nevertheless, this approach will may affect the entire scope of the app, potentially resulting in unforeseen behavior for other widgets.In this PR, I propose a straightforward solution that utilizes an ancestor widget (Ink) to manage the color state corresponding to
InkWell.overlayColor.Demo the fix
Screen.Recording.2025-04-24.at.15.16.37.mov
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.