Skip to content

Conversation

@goderbauer
Copy link
Member

@goderbauer goderbauer commented Jan 29, 2025

Fixes #158527

Adjustments:

  • Using the mouse/trackpad does no longer change FocusHighlightModes (this matches observed behavior on Android)
  • Changing focus via a11y on the web forces FocusHighlightModes.touch, which hides the visual input focus indication from non-Textfields. The reason here is in order to give something input focus on the web it also has to have a11y focus, which is indicated separately.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) f: focus Focus traversal, gaining or losing focus labels Jan 29, 2025
@github-actions github-actions bot added the f: material design flutter/packages/flutter/material repository. label Jan 30, 2025
@goderbauer
Copy link
Member Author

This is currently blocked on #162472, which is causing the g3 failures.

@goderbauer
Copy link
Member Author

Giving this another go now that #162472 is resolved. 🤞

@goderbauer
Copy link
Member Author

Arg, we have to wait for #162554 to roll into google3 to know that it fixes the issues there. I can confirm that in mylocal testing the issue appears to be fixed.

Onto writing some more tests for this...

@goderbauer goderbauer marked this pull request as ready for review February 4, 2025 19:19
Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

@yjbanov yjbanov changed the title Adjustments to FocusHighlightMode handeling Adjustments to FocusHighlightMode handling Feb 4, 2025
arguments is ByteData
? action.copyWith(arguments: const StandardMessageCodec().decodeMessage(arguments))
: action;
final List<ValueSetter<ui.SemanticsActionEvent>> localListeners = _semanticsActionListeners
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not immediately obvious what this is trying to do. AFAICT, this is creating a defensive copy to make sure the iterated list is not mutated during the loop. Maybe leave a comment, or give the variable a better name e.g. defensiveCopy or something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave a comment. This is a pattern that we use everywhere in the framework where listeners need to be called, though.

if (kIsWeb &&
semanticsActionEvent.type == SemanticsAction.focus &&
_lastInteractionWasTouch != true) {
_lastInteractionWasTouch = true;
Copy link
Contributor

@yjbanov yjbanov Feb 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is counter-intuitive that code that handles SemanticsAction.focus sets something called _lastInteractionWasTouch to true here. Perhaps it's time we renamed _lastInteractionWasTouch to something that reflects the intent, e.g. _lastInteractionRequiresNoHighlight (or if we want to remove double-negatives _lastInteractionRequiresHighlight).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming this is a good idea.

@goderbauer
Copy link
Member Author

Waiting on cl/723567941 to land. That should hopefully resolve the "google testing" issues.

Copy link
Contributor

@yjbanov yjbanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temporarily removing LGTM because my change, which this PR depends on, might have broken first-frame behavior. I'm looking into that right now.

Copy link
Contributor

@yjbanov yjbanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-LGTM. The first frame fix was fairly trivial: #162779

@goderbauer
Copy link
Member Author

goderbauer commented Feb 6, 2025

Kicking off another Google testing run... 🤞

@goderbauer goderbauer added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 6, 2025
@auto-submit
Copy link
Contributor

auto-submit bot commented Feb 6, 2025

autosubmit label was removed for flutter/flutter/162417, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Feb 6, 2025
@goderbauer goderbauer added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) f: focus Focus traversal, gaining or losing focus f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

With EnsureSemantics on, Buttons Maintain Focus State on Press

3 participants