-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[macOS] Use editing intents from engine #105407
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
[macOS] Use editing intents from engine #105407
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
Couple of issues:
@LongCatIsLooong, @justinmc, any thoughts? |
@@ -461,3 +487,78 @@ class DefaultTextEditingShortcuts extends StatelessWidget { | |||
); | |||
} | |||
} | |||
|
|||
// These constants are based on NSStandardKeyBindingResponding method names | |||
final Map<String, Intent> _stringToIntent = <String, Intent>{ |
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 have a WIP pull request before we went with the isComposing
hack, it's a bit more ambitious than just sending Intents from macOS: #94961. I'm still not sure if it's a good idea to turn other commands into intents, we can give this a try first.
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.
The selector names are specific to iOS/macOS. The method call name TextInputClient.performIntent
seems to be a little bit too generic for sending selector names to the framework. Or we could do the selector name -> Intent name translation in the engine.
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 wasn't sure if this approach was viable, so I didn't want to spent time translating selectors to generic names. One approach would be to map selectors in engine into something more resembling intents that we have (ie. with collapse/forward attributes). I'll give it a try.
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.
Or we can rename performIntent
to performSelector
. Also it's a bit strange that the intents are sent via the focus system despite that we already have an established TextInputConnection
.
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.
My gut says that the names sent from the engine should stay NSStandardKeyBindingResponding names. I imagine a developer might want to handle a specific NSStandardKeyBindingResponding command and we don't want to hide that from them. That's my thought.
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.
Or we can rename
performIntent
toperformSelector
. Also it's a bit strange that the intents are sent via the focus system despite that we already have an establishedTextInputConnection
.
We had a discussion about this with @matthew-carroll and he made same point. There could be performSelector
method on TextInputClient, which could, if needed, translate it to an Intent and pass it to focus system. That way it would also be possible to handle selectors that Flutter is not interested in.
packages/flutter/lib/src/widgets/default_text_editing_shortcuts.dart
Outdated
Show resolved
Hide resolved
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.
This approach looks pretty straightfoward to me. If @LongCatIsLooong is on board with doing this for now before something like #94961 then that sounds good to me.
packages/flutter/lib/src/widgets/default_text_editing_shortcuts.dart
Outdated
Show resolved
Hide resolved
packages/flutter/lib/src/widgets/default_text_editing_shortcuts.dart
Outdated
Show resolved
Hide resolved
@@ -461,3 +487,78 @@ class DefaultTextEditingShortcuts extends StatelessWidget { | |||
); | |||
} | |||
} | |||
|
|||
// These constants are based on NSStandardKeyBindingResponding method names | |||
final Map<String, Intent> _stringToIntent = <String, Intent>{ |
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.
My gut says that the names sent from the engine should stay NSStandardKeyBindingResponding names. I imagine a developer might want to handle a specific NSStandardKeyBindingResponding command and we don't want to hide that from them. That's my thought.
packages/flutter/lib/src/widgets/default_text_editing_shortcuts.dart
Outdated
Show resolved
Hide resolved
|
||
'transpose': const TransposeCharactersIntent(), | ||
|
||
// TODO(knopp): Page Up/Down intents are missing |
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 opened a PR for pageup/down in text editing here: #105497
|
||
/// Performs macOS specific selector from the NSStandardKeyBindingResponding | ||
/// protocol. | ||
void performSelector(String selectorName) {} |
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.
One more thing I just thought of: I want to make sure that this is something that we want to add to TextInputClient and not split out. We've been having a bunch of discussion about this topic, see this design doc: https://docs.google.com/document/d/1OxDsf_eot7TlsRn57z-1_dGbvuqnMxO7QEGIAmOCZtA/edit
2c1a76f
to
a0d6616
Compare
c43f8c1
to
a5c8b35
Compare
33f4768
to
7466b87
Compare
// Escape when there's no IME selection | ||
'cancelOperation:': const DismissIntent(), | ||
// Tab when there's no IME selection | ||
'insertTab:': const NextFocusIntent(), |
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.
why is insertTab
mapped to focus change instead of inserting a tab to the currently focused text field?
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.
Because that's what would happen without this PR. The NextFocusIntent
action has own shortcut (_defaultShortcuts
) and default text editing shortcuts don't override this. With the exception of macOS in this PR because we need to feed tab to TextInputContext
.
Tab handling (and rendering) does need some work, but it feels like it is out of scope of this PR.
packages/flutter/lib/src/widgets/default_text_editing_shortcuts.dart
Outdated
Show resolved
Hide resolved
}) { | ||
return KeyEventSimulator.simulateKeyDownEvent(key, platform: platform, physicalKey: physicalKey, character: character); | ||
}) async { | ||
final bool handled = await KeyEventSimulator.simulateKeyDownEvent(key, platform: platform, physicalKey: physicalKey, character: character); |
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'm not entirely sure we should do this. This can be used when there's no text input control present. /cc @dkwingsmt
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 think we should just verify the selectors are handled correctly instead of trying to verify the key presses are handled correctly.
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.
TestWidgetsFlutterBinding.testTextInput
is not nullable. So if binding is TestWidgetsFlutterBinding
the text input should be present.
The purpose of this code is to turn unhandled key events into selectors, if text input is currently active, same way FlutterTextInputPlugin
does it on macOS. There are (almost) no keyboard editing/navigation shortcuts defined for macOS anymore, everything is driven by selectors, so Flutter Tester must be able to simulate the environment, otherwise most text editing tests just fail on macOS.
That said, I don't know if event_simulation
is the right place to do this.
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 think this process is reasonable. The entire test binding is to emulate a real device, and this new logic reflects our new model for the macOS system, which translates unhandled key events into selectors.
@@ -1125,6 +1125,10 @@ abstract class TextInputClient { | |||
|
|||
/// Requests that the client remove the text placeholder. | |||
void removeTextPlaceholder() {} | |||
|
|||
/// Performs macOS specific selector from the NSStandardKeyBindingResponding |
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.
If the app user has a custom selector defined in DefaultKeyBinding.Dict
, the selector will be sent as-is to the framework right? So it's not necessarily from NSStandardKeyBindingResponding
.
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.
Also in DefaultKeyBinding.Dict
you can remap a key to a selector + parameters. An example:
"~h" = ("insertText:", "hello word", "moveBackward:");
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.
Also using the current primary focus seems to be a reasonable default implementation.
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 don't know if AppKit would deliver completly custom selectors to doCommandBySelector:
. I can try it though.
insertText:
is not processed through doCommandBySelector:
(and there is no argument other than selector there).
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.
Nevermind, custom selectors are delivered. I'll update the 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.
Yeah I think it worked for me when I tried a custom selector (a random string really). But I didn't try a selector with a parameter list. The documentation I found didn't mention that either: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/TextDefaultsBindings/TextDefaultsBindings.html
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.
The signature of doCommandBySelector:
only has one argument (the selector), so I don't see how parameters would work, but custom selectors certainly do.
ea6c7f6
to
160eceb
Compare
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.
Some more improvements here. Thanks for following up on all this!
|
||
/// Performs macOS specific selector from the `NSStandardKeyBindingResponding` | ||
/// protocol or user specified selector from `DefaultKeyBinding.Dict`. | ||
void performSelector(String selectorName) {} |
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.
Could this be more generic than text input? Maybe it should have its own class instead of being a part of TextInputClient?
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.
The selector is sent from TextInputContext, which is only used through the TextInputClient.
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.
Agreed after looking at the engine PR again.
If anyone is using TextInputClient with the implements
keyword`, then they will be broken by this change. We should keep an eye out for that.
FYI here is a design doc that I wrote recently about adding platform methods. I think in this case we're all onboard with that pattern.
const SingleActivator(LogicalKeyboardKey.keyZ, meta: true): const UndoTextIntent(SelectionChangedCause.keyboard), | ||
const SingleActivator(LogicalKeyboardKey.keyZ, shift: true, meta: true): const RedoTextIntent(SelectionChangedCause.keyboard), | ||
|
||
// On desktop these keys should go to the IME when a field is focused, not to other |
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.
On all desktop platforms or only on Mac?
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.
Only on Mac (the comment is inside _macShortcuts), but not on web on mac (hence "desktop").
'pageUpAndModifySelection': ExpandSelectionToDocumentBoundaryIntent(forward: false), | ||
'pageDownAndModifySelection:': ExpandSelectionToDocumentBoundaryIntent(forward: true), | ||
|
||
// Escape when there's no IME selection |
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.
Period at the end.
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.
By "no IME selection" do you mean no field is focused or no TextEditingValue.selection is collapsed?
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 meant the IME candidate selection popup. When there is a popup TextInputContext will eat the escape key (hiding the popup). If there is no popup, TextInputContext will produce cancelOperation:
selector, which we map to DismissIntent
.
packages/flutter/lib/src/widgets/default_text_editing_shortcuts.dart
Outdated
Show resolved
Hide resolved
4b7fa08
to
1897d1f
Compare
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 👍
Probably should let @LongCatIsLooong give a final review as well.
|
||
/// Performs macOS specific selector from the `NSStandardKeyBindingResponding` | ||
/// protocol or user specified selector from `DefaultKeyBinding.Dict`. | ||
void performSelector(String selectorName) {} |
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.
Agreed after looking at the engine PR again.
If anyone is using TextInputClient with the implements
keyword`, then they will be broken by this change. We should keep an eye out for that.
FYI here is a design doc that I wrote recently about adding platform methods. I think in this case we're all onboard with that pattern.
606008c
to
1f1a33d
Compare
key == LogicalKeyboardKey.metaLeft || | ||
key == LogicalKeyboardKey.metaRight) { | ||
_meta = true; | ||
} else { |
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.
Why no controls?
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.
Seems like an oversight. Also this should have caught by tests. I'll look into this.
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.
Indeed, control was missing :-/ The transpose test didn't fail, because, because Control+T did result in transpose:
selector selector. The issue is that without checking for control Just T
itself would result in transpose:
as well. Fixed.
}) { | ||
return KeyEventSimulator.simulateKeyDownEvent(key, platform: platform, physicalKey: physicalKey, character: character); | ||
}) async { | ||
final bool handled = await KeyEventSimulator.simulateKeyDownEvent(key, platform: platform, physicalKey: physicalKey, character: character); |
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 think this process is reasonable. The entire test binding is to emulate a real device, and this new logic reflects our new model for the macOS system, which translates unhandled key events into selectors.
The change LGTM except for the one question. |
1f1a33d
to
3310569
Compare
This PR will need flutter/engine#33838 to be rolled into flutter/flutter to avoid breaking. This might take a few days. |
@dkwingsmt This should be aready in (#108602 merged). |
@tgucio That was way faster than my past experience! Thanks for letting me know. |
Is this PR ready to go? Shall we add auto-submit to it? |
* M3 counter error style * polish * Update text_field_template.dart * Roll Flutter Engine from 3cba105 to cf0db3e (1 revision) (#108716) * resolve comments * Roll Plugins from 257eacb1e2aa to a6d42f1e01d3 (3 revisions) (#108738) * Override PlaceholderDimensions equality operator to avoid unnecessary TextPainter re-layouts (#108623) * Roll Flutter Engine from cf0db3e to aa90044 (1 revision) (#108734) * Roll Flutter Engine from aa90044 to 6d2fd23 (5 revisions) (#108744) * Fix lerp to eccentric circle. (#108743) * Roll Flutter Engine from 6d2fd23 to f182794 (4 revisions) (#108749) * Roll Flutter Engine from f182794 to 25e8021 (1 revision) (#108751) * Sync with flutter/.github#13 (#108754) * Roll Flutter Engine from 25e8021 to e771729 (2 revisions) (#108755) * clean-up analysis_options.yaml (#108747) * Fix ExpansionTile shows children background when expanded (#107834) * Create `containsSemantics` to allow for partial matching of semantics in tests. (#108573) * Roll Flutter Engine from e771729 to 7d0f6d2 (2 revisions) (#108757) * Enable conditional_uri_does_not_exist (#108652) * Roll Flutter Engine from 7d0f6d2 to b257966 (3 revisions) (#108763) * Roll Flutter Engine from b257966 to 60e5eb6 (3 revisions) (#108766) * Reland `Linux_samsung_a02 openpay_benchmarks__scroll_perf` (#108466) (#108769) * [SelectionOverlay]Move the debug statement to the scope of the assertion. (#108508) * Roll Flutter Engine from 60e5eb6 to 1c3b1b3 (11 revisions) (#108780) * Roll Flutter Engine from 1c3b1b3 to b607811 (1 revision) (#108782) * Roll Flutter Engine from b607811 to 3b2bd24 (1 revision) (#108784) * Roll Flutter Engine from 3b2bd24 to 0e5392c (1 revision) (#108788) * Roll Flutter Engine from 0e5392c to 4b19256 (1 revision) (#108793) * Roll Flutter Engine from 4b19256 to e0b5edc (2 revisions) (#108798) * Roll Flutter Engine from e0b5edc to b164c5c (1 revision) (#108814) * Update text_field.dart * Roll Flutter Engine from b164c5c to eb2b57b (4 revisions) (#108821) * Roll Plugins from a6d42f1e01d3 to 0d6d03a94ed5 (1 revision) (#108822) * Roll Flutter Engine from eb2b57b to 978d8e2 (2 revisions) (#108825) * Loupe Android + iOS (#107477) * added Magnifier for iOS and Android * Mark `Mac_ios microbenchmarks_ios_flaky` flaky (#108820) * Deprecate `toggleableActiveColor` (#97972) * Roll Flutter Engine from 978d8e2 to 2b31732 (4 revisions) (#108830) * [flutter_tools] Test that DAP process terminates at the end of a session (#108301) * Roll Flutter Engine from 2b31732 to 4e9c869 (1 revision) (#108833) * fix noop toString() diagnostics (#108836) * [flutter_tools] Migrate more tool tests to null-safety (#108639) * Revert "Fix ExpansionTile shows children background when expanded" (#108844) * Roll Flutter Engine from 4e9c869 to 6724561 (2 revisions) (#108838) * Marks Linux_android clipper_cache_perf__e2e_summary to be unflaky (#104088) * Update documentation to match implementation (#108843) * Reland "Add shadowColor and surfaceTintColor to Dialog and DialogTheme." #108718 * Roll Flutter Engine from 6724561 to f3deaba (8 revisions) (#108847) * Roll Flutter Engine from f3deaba to c07e1ac (2 revisions) (#108849) * Roll Flutter Engine from c07e1ac to a1e77ae (5 revisions) (#108850) * Roll Flutter Engine from a1e77ae to c456476 (2 revisions) (#108853) * Roll Flutter Engine from c456476 to 6cd744b (1 revision) (#108857) * Roll Flutter Engine from 6cd744b to 51296a6 (1 revision) (#108860) * Roll Flutter Engine from 51296a6 to 05228ad (1 revision) (#108862) * Revert "Roll Flutter Engine from 51296a6 to 05228ad (1 revision) (#108862)" (#108882) This reverts commit a880c4e. * Roll Plugins from 0d6d03a94ed5 to e74c42028d39 (5 revisions) (#108887) * Roll Flutter Engine from 51296a6 to 2c28298 (6 revisions) (#108899) * [flutter_test] Add flag to send device pointer events to the framework (#108430) * Roll Flutter Engine from 2c28298 to adba702 (2 revisions) (#108903) * fix flutter not finding custom device (#108884) * Force a11y services to off for complex_layout_semantics_perf test (#108906) * Update `equalsIgnoringHashCodes` to take a list of Strings (#108507) * [macOS] Use editing intents from engine (#105407) * Added `IconButtonTheme` and apply it to `IconButton` in M3 (#108332) * Created IconButtonTheme and apply it to IconButton * [web] Add onEntrypointLoaded to FlutterLoader. (#108776) * Roll pub packages (#108919) * [flutter_test] perf: find.ancestor (#108868) * Roll Flutter Engine from adba702 to 1188a80 (4 revisions) (#108922) * Bump github/codeql-action from 2.1.17 to 2.1.18 (#108923) * Remove some outdated ignores from framework (#108915) * Roll Flutter Engine from 1188a80 to 1743d1d (1 revision) (#108925) * Clean up ScrollbarPainter (#107179) * Remove outdated ignores (#108924) * Add more logs to diagnose Gold flake (#108930) * M3 counter error style * polish * Update text_field_template.dart * resolve comments * Update text_field.dart Co-authored-by: engine-flutter-autoroll <[email protected]> Co-authored-by: Tomasz Gucio <[email protected]> Co-authored-by: Greg Spencer <[email protected]> Co-authored-by: Ian Hickson <[email protected]> Co-authored-by: Michael Goderbauer <[email protected]> Co-authored-by: Bruno Leroux <[email protected]> Co-authored-by: pdblasi-google <[email protected]> Co-authored-by: Kaushik Iska <[email protected]> Co-authored-by: xubaolin <[email protected]> Co-authored-by: Anthony Oleinik <[email protected]> Co-authored-by: keyonghan <[email protected]> Co-authored-by: Taha Tesser <[email protected]> Co-authored-by: Danny Tuppeny <[email protected]> Co-authored-by: Phil Quitslund <[email protected]> Co-authored-by: Christopher Fujino <[email protected]> Co-authored-by: Kate Lovett <[email protected]> Co-authored-by: Flutter GitHub Bot <[email protected]> Co-authored-by: parkershepherd <[email protected]> Co-authored-by: Darren Austin <[email protected]> Co-authored-by: Zachary Anderson <[email protected]> Co-authored-by: Jia Hao <[email protected]> Co-authored-by: Hannes Winkler <[email protected]> Co-authored-by: Matej Knopp <[email protected]> Co-authored-by: Qun Cheng <[email protected]> Co-authored-by: David Iglesias <[email protected]> Co-authored-by: Pascal Welsch <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* M3 counter error style * polish * Update text_field_template.dart * Roll Flutter Engine from 3cba105 to cf0db3e (1 revision) (flutter#108716) * resolve comments * Roll Plugins from 257eacb1e2aa to a6d42f1e01d3 (3 revisions) (flutter#108738) * Override PlaceholderDimensions equality operator to avoid unnecessary TextPainter re-layouts (flutter#108623) * Roll Flutter Engine from cf0db3e to aa90044 (1 revision) (flutter#108734) * Roll Flutter Engine from aa90044 to 6d2fd23 (5 revisions) (flutter#108744) * Fix lerp to eccentric circle. (flutter#108743) * Roll Flutter Engine from 6d2fd23 to f182794 (4 revisions) (flutter#108749) * Roll Flutter Engine from f182794 to 25e8021 (1 revision) (flutter#108751) * Sync with flutter/.github#13 (flutter#108754) * Roll Flutter Engine from 25e8021 to e771729 (2 revisions) (flutter#108755) * clean-up analysis_options.yaml (flutter#108747) * Fix ExpansionTile shows children background when expanded (flutter#107834) * Create `containsSemantics` to allow for partial matching of semantics in tests. (flutter#108573) * Roll Flutter Engine from e771729 to 7d0f6d2 (2 revisions) (flutter#108757) * Enable conditional_uri_does_not_exist (flutter#108652) * Roll Flutter Engine from 7d0f6d2 to b257966 (3 revisions) (flutter#108763) * Roll Flutter Engine from b257966 to 60e5eb6 (3 revisions) (flutter#108766) * Reland `Linux_samsung_a02 openpay_benchmarks__scroll_perf` (flutter#108466) (flutter#108769) * [SelectionOverlay]Move the debug statement to the scope of the assertion. (flutter#108508) * Roll Flutter Engine from 60e5eb6 to 1c3b1b3 (11 revisions) (flutter#108780) * Roll Flutter Engine from 1c3b1b3 to b607811 (1 revision) (flutter#108782) * Roll Flutter Engine from b607811 to 3b2bd24 (1 revision) (flutter#108784) * Roll Flutter Engine from 3b2bd24 to 0e5392c (1 revision) (flutter#108788) * Roll Flutter Engine from 0e5392c to 4b19256 (1 revision) (flutter#108793) * Roll Flutter Engine from 4b19256 to e0b5edc (2 revisions) (flutter#108798) * Roll Flutter Engine from e0b5edc to b164c5c (1 revision) (flutter#108814) * Update text_field.dart * Roll Flutter Engine from b164c5c to eb2b57b (4 revisions) (flutter#108821) * Roll Plugins from a6d42f1e01d3 to 0d6d03a94ed5 (1 revision) (flutter#108822) * Roll Flutter Engine from eb2b57b to 978d8e2 (2 revisions) (flutter#108825) * Loupe Android + iOS (flutter#107477) * added Magnifier for iOS and Android * Mark `Mac_ios microbenchmarks_ios_flaky` flaky (flutter#108820) * Deprecate `toggleableActiveColor` (flutter#97972) * Roll Flutter Engine from 978d8e2 to 2b31732 (4 revisions) (flutter#108830) * [flutter_tools] Test that DAP process terminates at the end of a session (flutter#108301) * Roll Flutter Engine from 2b31732 to 4e9c869 (1 revision) (flutter#108833) * fix noop toString() diagnostics (flutter#108836) * [flutter_tools] Migrate more tool tests to null-safety (flutter#108639) * Revert "Fix ExpansionTile shows children background when expanded" (flutter#108844) * Roll Flutter Engine from 4e9c869 to 6724561 (2 revisions) (flutter#108838) * Marks Linux_android clipper_cache_perf__e2e_summary to be unflaky (flutter#104088) * Update documentation to match implementation (flutter#108843) * Reland "Add shadowColor and surfaceTintColor to Dialog and DialogTheme." flutter#108718 * Roll Flutter Engine from 6724561 to f3deaba (8 revisions) (flutter#108847) * Roll Flutter Engine from f3deaba to c07e1ac (2 revisions) (flutter#108849) * Roll Flutter Engine from c07e1ac to a1e77ae (5 revisions) (flutter#108850) * Roll Flutter Engine from a1e77ae to c456476 (2 revisions) (flutter#108853) * Roll Flutter Engine from c456476 to 6cd744b (1 revision) (flutter#108857) * Roll Flutter Engine from 6cd744b to 51296a6 (1 revision) (flutter#108860) * Roll Flutter Engine from 51296a6 to 05228ad (1 revision) (flutter#108862) * Revert "Roll Flutter Engine from 51296a6 to 05228ad (1 revision) (flutter#108862)" (flutter#108882) This reverts commit a880c4e. * Roll Plugins from 0d6d03a94ed5 to e74c42028d39 (5 revisions) (flutter#108887) * Roll Flutter Engine from 51296a6 to 2c28298 (6 revisions) (flutter#108899) * [flutter_test] Add flag to send device pointer events to the framework (flutter#108430) * Roll Flutter Engine from 2c28298 to adba702 (2 revisions) (flutter#108903) * fix flutter not finding custom device (flutter#108884) * Force a11y services to off for complex_layout_semantics_perf test (flutter#108906) * Update `equalsIgnoringHashCodes` to take a list of Strings (flutter#108507) * [macOS] Use editing intents from engine (flutter#105407) * Added `IconButtonTheme` and apply it to `IconButton` in M3 (flutter#108332) * Created IconButtonTheme and apply it to IconButton * [web] Add onEntrypointLoaded to FlutterLoader. (flutter#108776) * Roll pub packages (flutter#108919) * [flutter_test] perf: find.ancestor (flutter#108868) * Roll Flutter Engine from adba702 to 1188a80 (4 revisions) (flutter#108922) * Bump github/codeql-action from 2.1.17 to 2.1.18 (flutter#108923) * Remove some outdated ignores from framework (flutter#108915) * Roll Flutter Engine from 1188a80 to 1743d1d (1 revision) (flutter#108925) * Clean up ScrollbarPainter (flutter#107179) * Remove outdated ignores (flutter#108924) * Add more logs to diagnose Gold flake (flutter#108930) * M3 counter error style * polish * Update text_field_template.dart * resolve comments * Update text_field.dart Co-authored-by: engine-flutter-autoroll <[email protected]> Co-authored-by: Tomasz Gucio <[email protected]> Co-authored-by: Greg Spencer <[email protected]> Co-authored-by: Ian Hickson <[email protected]> Co-authored-by: Michael Goderbauer <[email protected]> Co-authored-by: Bruno Leroux <[email protected]> Co-authored-by: pdblasi-google <[email protected]> Co-authored-by: Kaushik Iska <[email protected]> Co-authored-by: xubaolin <[email protected]> Co-authored-by: Anthony Oleinik <[email protected]> Co-authored-by: keyonghan <[email protected]> Co-authored-by: Taha Tesser <[email protected]> Co-authored-by: Danny Tuppeny <[email protected]> Co-authored-by: Phil Quitslund <[email protected]> Co-authored-by: Christopher Fujino <[email protected]> Co-authored-by: Kate Lovett <[email protected]> Co-authored-by: Flutter GitHub Bot <[email protected]> Co-authored-by: parkershepherd <[email protected]> Co-authored-by: Darren Austin <[email protected]> Co-authored-by: Zachary Anderson <[email protected]> Co-authored-by: Jia Hao <[email protected]> Co-authored-by: Hannes Winkler <[email protected]> Co-authored-by: Matej Knopp <[email protected]> Co-authored-by: Qun Cheng <[email protected]> Co-authored-by: David Iglesias <[email protected]> Co-authored-by: Pascal Welsch <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
## Description This PR fixes a focus traversal issue for read-only TextField on macOS. # Implementation details On macOS, some editing capabilities are handled differently compared to other platforms. Since #105407, the macOS engine send editing selectors to the framework. To do so a text input connection should be opened. Before this PR there was no text input connection for a read-only EditableText which means several shortcut were not handled, especially tab traversal (but also selection shortcuts using arrows). After this PR an input connection is always created on macOS even if an EditableText is read-only. ## Related Issue Fixes [Read-only TextField prevents focus from changing](#161482) ## Tests Adds 1 test.
Fixes #85328
Requires flutter/engine#33838
This PR removes most of macOS specific text editing shortcut definitions and instead listens to appropriate selector messages from the engine, translating them into intents.
In order for text editing tests to work correctly, FlutterTester translates unhandled key events (only when
defaultTargetPlatform == macOS
and active text input) to selectors, similarly to how the engine would.If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.