[go: nahoru, domu]

Skip to content
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

Docs on the interaction between Shortcuts and text input #144328

Merged
merged 2 commits into from
Feb 29, 2024

Conversation

justinmc
Copy link
Contributor

I was talking with @tvolkert about the complex behavior of Shortcuts when a text field is focused. I created this dartpad to illustrate the problem, which shows a key being stolen from a text field by Shortcuts, and how to prevent that using DoNothingAndStopPropagationIntent.

This PR adds a section in the docs explaining how all of this works and how to override this "stealing" problem.

@justinmc justinmc self-assigned this Feb 28, 2024
@justinmc justinmc marked this pull request as ready for review February 28, 2024 18:22
@github-actions github-actions bot added a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. labels Feb 28, 2024
/// When a keystroke is received in Flutter's engine, it first gives the
/// framework the opportunity to handle it as a raw key event through
/// [SystemChannels.keyEvent]. This is what [Shortcuts] listens to indirectly
/// through its [FocusNode]. If it is not handled, then it will procede to try
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// through its [FocusNode]. If it is not handled, then it will procede to try
/// through its [FocusNode]. If it is not handled, then it will proceed to try

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

Copy link
Contributor
@LongCatIsLooong LongCatIsLooong left a comment

Choose a reason for hiding this comment

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

nit: add the interacton part to [DefaultTextEditingShortcuts] too?

@justinmc justinmc added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 28, 2024
@auto-submit auto-submit bot merged commit ac66b29 into flutter:master Feb 29, 2024
65 checks passed
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Feb 29, 2024
flutter/flutter@d00bfe8...e92bca3

2024-02-29 leroux_bruno@yahoo.fr [flutter_tools] Update external link in Android manifest template (flutter/flutter#144302)
2024-02-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 232217f39c3c to d068d980f952 (1 revision) (flutter/flutter#144369)
2024-02-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 9e1876141be8 to 232217f39c3c (1 revision) (flutter/flutter#144366)
2024-02-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 61510db94a1c to 9e1876141be8 (1 revision) (flutter/flutter#144362)
2024-02-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 10331db8f748 to 61510db94a1c (5 revisions) (flutter/flutter#144355)
2024-02-29 jmccandless@google.com Docs on the interaction between Shortcuts and text input (flutter/flutter#144328)
2024-02-29 dnfield@google.com Use robolectric/AndroidJUnit4 for integration test tests (flutter/flutter#144348)
2024-02-29 31859944+LongCatIsLooong@users.noreply.github.com Reland "Cache FocusNode.enclosingScope, clean up descendantsAreFocusable (#144207)" (flutter/flutter#144330)
2024-02-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 455c814fe5de to 10331db8f748 (7 revisions) (flutter/flutter#144345)
2024-02-29 dkwingsmt@users.noreply.github.com ReportTiming callback should record the sendFrameToEngine when it was scheduled (flutter/flutter#144212)
2024-02-29 katelovett@google.com Disable flaky golden file test (flutter/flutter#144351)
2024-02-28 jmccandless@google.com Mention SelectionArea in SelectableText docs (flutter/flutter#143784)
2024-02-28 49699333+dependabot[bot]@users.noreply.github.com Bump peter-evans/create-pull-request from 6.0.0 to 6.0.1 (flutter/flutter#144344)
2024-02-28 36861262+QuncCccccc@users.noreply.github.com Reland "Reland - Introduce tone-based surfaces and accent color add-ons - Part 2" (flutter/flutter#144273)
2024-02-28 72562119+tgucio@users.noreply.github.com Remove irrelevant comment in TextPainter (flutter/flutter#144308)

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 bmparr@google.com,rmistry@google.com,stuartmorgan@google.com 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
@justinmc justinmc deleted the docs-shortcuts-and-input branch February 29, 2024 18:43
LouiseHsu pushed a commit to LouiseHsu/packages that referenced this pull request Mar 7, 2024
…r#6227)

flutter/flutter@d00bfe8...e92bca3

2024-02-29 leroux_bruno@yahoo.fr [flutter_tools] Update external link in Android manifest template (flutter/flutter#144302)
2024-02-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 232217f39c3c to d068d980f952 (1 revision) (flutter/flutter#144369)
2024-02-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 9e1876141be8 to 232217f39c3c (1 revision) (flutter/flutter#144366)
2024-02-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 61510db94a1c to 9e1876141be8 (1 revision) (flutter/flutter#144362)
2024-02-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 10331db8f748 to 61510db94a1c (5 revisions) (flutter/flutter#144355)
2024-02-29 jmccandless@google.com Docs on the interaction between Shortcuts and text input (flutter/flutter#144328)
2024-02-29 dnfield@google.com Use robolectric/AndroidJUnit4 for integration test tests (flutter/flutter#144348)
2024-02-29 31859944+LongCatIsLooong@users.noreply.github.com Reland "Cache FocusNode.enclosingScope, clean up descendantsAreFocusable (#144207)" (flutter/flutter#144330)
2024-02-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 455c814fe5de to 10331db8f748 (7 revisions) (flutter/flutter#144345)
2024-02-29 dkwingsmt@users.noreply.github.com ReportTiming callback should record the sendFrameToEngine when it was scheduled (flutter/flutter#144212)
2024-02-29 katelovett@google.com Disable flaky golden file test (flutter/flutter#144351)
2024-02-28 jmccandless@google.com Mention SelectionArea in SelectableText docs (flutter/flutter#143784)
2024-02-28 49699333+dependabot[bot]@users.noreply.github.com Bump peter-evans/create-pull-request from 6.0.0 to 6.0.1 (flutter/flutter#144344)
2024-02-28 36861262+QuncCccccc@users.noreply.github.com Reland "Reland - Introduce tone-based surfaces and accent color add-ons - Part 2" (flutter/flutter#144273)
2024-02-28 72562119+tgucio@users.noreply.github.com Remove irrelevant comment in TextPainter (flutter/flutter#144308)

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 bmparr@google.com,rmistry@google.com,stuartmorgan@google.com 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
arc-yong pushed a commit to Arctuition/packages-arc that referenced this pull request Jun 14, 2024
…r#6227)

flutter/flutter@d00bfe8...e92bca3

2024-02-29 leroux_bruno@yahoo.fr [flutter_tools] Update external link in Android manifest template (flutter/flutter#144302)
2024-02-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 232217f39c3c to d068d980f952 (1 revision) (flutter/flutter#144369)
2024-02-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 9e1876141be8 to 232217f39c3c (1 revision) (flutter/flutter#144366)
2024-02-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 61510db94a1c to 9e1876141be8 (1 revision) (flutter/flutter#144362)
2024-02-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 10331db8f748 to 61510db94a1c (5 revisions) (flutter/flutter#144355)
2024-02-29 jmccandless@google.com Docs on the interaction between Shortcuts and text input (flutter/flutter#144328)
2024-02-29 dnfield@google.com Use robolectric/AndroidJUnit4 for integration test tests (flutter/flutter#144348)
2024-02-29 31859944+LongCatIsLooong@users.noreply.github.com Reland "Cache FocusNode.enclosingScope, clean up descendantsAreFocusable (#144207)" (flutter/flutter#144330)
2024-02-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 455c814fe5de to 10331db8f748 (7 revisions) (flutter/flutter#144345)
2024-02-29 dkwingsmt@users.noreply.github.com ReportTiming callback should record the sendFrameToEngine when it was scheduled (flutter/flutter#144212)
2024-02-29 katelovett@google.com Disable flaky golden file test (flutter/flutter#144351)
2024-02-28 jmccandless@google.com Mention SelectionArea in SelectableText docs (flutter/flutter#143784)
2024-02-28 49699333+dependabot[bot]@users.noreply.github.com Bump peter-evans/create-pull-request from 6.0.0 to 6.0.1 (flutter/flutter#144344)
2024-02-28 36861262+QuncCccccc@users.noreply.github.com Reland "Reland - Introduce tone-based surfaces and accent color add-ons - Part 2" (flutter/flutter#144273)
2024-02-28 72562119+tgucio@users.noreply.github.com Remove irrelevant comment in TextPainter (flutter/flutter#144308)

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 bmparr@google.com,rmistry@google.com,stuartmorgan@google.com 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: text input Entering text in a text field or keyboard related problems autosubmit Merge PR when tree becomes green via auto submit App framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants