-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Adjustments to FocusHighlightMode handling #162417
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
Conversation
d849f5a to
375bbdc
Compare
|
This is currently blocked on #162472, which is causing the g3 failures. |
375bbdc to
124ca4a
Compare
|
Giving this another go now that #162472 is resolved. 🤞 |
|
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... |
gspencergoog
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.
| arguments is ByteData | ||
| ? action.copyWith(arguments: const StandardMessageCodec().decodeMessage(arguments)) | ||
| : action; | ||
| final List<ValueSetter<ui.SemanticsActionEvent>> localListeners = _semanticsActionListeners |
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.
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?
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.
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; |
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.
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).
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.
Renaming this is a good idea.
|
Waiting on cl/723567941 to land. That should hopefully resolve the "google testing" issues. |
yjbanov
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.
Temporarily removing LGTM because my change, which this PR depends on, might have broken first-frame behavior. I'm looking into that right now.
yjbanov
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.
Re-LGTM. The first frame fix was fairly trivial: #162779
65ff524 to
f3b9c49
Compare
|
Kicking off another Google testing run... 🤞 |
|
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. |

Fixes #158527
Adjustments:
FocusHighlightModes (this matches observed behavior on Android)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.