Skip to content

Conversation

@bleroux
Copy link
Contributor

@bleroux bleroux commented May 23, 2024

Description

This PRs fixes a Web issue on Linux related to numpad keys.
In #145464, I introduced numpad shortcuts for Linux. These shortcuts work well on a desktop Linux application but they broke the Linux+Web numpad logic.

When I added these shortcuts, I expected them to not be active on Web (because I knew that on Web, those shortcuts are handled by the browser). But there is a trick: text editing shortcuts are still defined on Web but they are disabled at the editable text level so one can use them in components that are not EditableText (see #103377).
In this PR, I used the same approach than for other text editing shortcuts: when on web associate those shortcuts to the DoNothingAndStopPropagationTextIntent intent.

Related Issue

Fixes #148447.

Tests

Updates 2 tests.
Adds 2 tests.

@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 May 23, 2024
@bleroux bleroux force-pushed the fix_linux_numpad_shortcuts_on_web branch from 7234146 to b8c3f3c Compare May 23, 2024 19:26
@justinmc justinmc self-requested a review May 23, 2024 21:49
@bleroux bleroux force-pushed the fix_linux_numpad_shortcuts_on_web branch 2 times, most recently from 7d54c57 to c013eb1 Compare May 24, 2024 13:47
Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

LGTM 👍 . Tricky catch. Thanks for the thorough tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Typically I'd see the closing parenthesis on the next line. Here and below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did it on purpose because the analyzer was failing and complaining about skip requiring a comment.
I tried various format and that one was ok.
After seeing your comment, I had a closer look to the analyzer failure and, base on https://github.com/flutter/flutter/wiki/Tree-hygiene#skipped-tests, I figured out that the lint is about having an URL or [intended] in the comment, knowing this I was able to update the PR with a proper formatting.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah cool, thank you!

@bleroux bleroux force-pushed the fix_linux_numpad_shortcuts_on_web branch from c013eb1 to 4791efa Compare May 25, 2024 13:06
@bleroux bleroux force-pushed the fix_linux_numpad_shortcuts_on_web branch from 4791efa to 8069001 Compare May 25, 2024 14:00
@bleroux bleroux added the autosubmit Merge PR when tree becomes green via auto submit App label May 25, 2024
@auto-submit auto-submit bot merged commit 0f3882e into flutter:master May 25, 2024
@bhuphathi
Copy link

"Thanks, @bleroux This is helpful."

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 26, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 26, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request May 26, 2024
flutter/flutter@cb26a01...6564471

2024-05-26 [email protected] Roll Flutter Engine from a207dfe8e96b to f3025ae1511b (1 revision) (flutter/flutter#149098)
2024-05-25 [email protected] Manual roll Flutter Engine from 1d154ff93a87 to a207dfe8e96b (10 revisions) (flutter/flutter#149096)
2024-05-25 [email protected] Fix Linux numpad shortcuts on web (flutter/flutter#148988)

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],[email protected],[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
@bleroux bleroux deleted the fix_linux_numpad_shortcuts_on_web branch May 27, 2024 05:00
victorsanni pushed a commit to victorsanni/flutter that referenced this pull request May 31, 2024
## Description

This PRs fixes a Web issue on Linux related to numpad keys.
In flutter#145464, I introduced numpad shortcuts for Linux. These shortcuts work well on a desktop Linux application but they broke the Linux+Web numpad logic.

When I added these shortcuts, I expected them to not be active on Web (because I knew that on Web, those shortcuts are handled by the browser). But there is a trick: text editing shortcuts are still defined on Web but they are disabled at the editable text level so one can use them in components that are not `EditableText` (see flutter#103377).
In this PR, I used the same approach than for other text editing shortcuts: when on web associate those shortcuts to the `DoNothingAndStopPropagationTextIntent` intent.

## Related Issue

Fixes flutter#148447.

## Tests

Updates 2 tests.
Adds 2 tests.
@m3c-fnicola
Copy link

Will this be cherry-picked to the stable branch? Our product currently depends on this fix as many of our users rely on numpad functionality, and we're experiencing a significant blockage due to this issue. We might need to downgrade to a previous stable version of Flutter that does not have this problem.

Thanks for your assistance!

@bleroux
Copy link
Contributor Author

bleroux commented Jun 24, 2024

m3c-fnicola pushed a commit to m3c-fnicola/flutter that referenced this pull request Jun 24, 2024
## Description

This PRs fixes a Web issue on Linux related to numpad keys.
In flutter#145464, I introduced numpad shortcuts for Linux. These shortcuts work well on a desktop Linux application but they broke the Linux+Web numpad logic.

When I added these shortcuts, I expected them to not be active on Web (because I knew that on Web, those shortcuts are handled by the browser). But there is a trick: text editing shortcuts are still defined on Web but they are disabled at the editable text level so one can use them in components that are not `EditableText` (see flutter#103377).
In this PR, I used the same approach than for other text editing shortcuts: when on web associate those shortcuts to the `DoNothingAndStopPropagationTextIntent` intent.

## Related Issue

Fixes flutter#148447.

## Tests

Updates 2 tests.
Adds 2 tests.
auto-submit bot pushed a commit that referenced this pull request Jul 1, 2024
Cherry pick request of #148988 to stable.

Fixes an issue on Web+Linux that prevents users from inputting data using the numpad.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 6, 2024
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.

[Linux][Web]: Bug while pressing Numeric Keypad keys on web with Flutter last stable version

4 participants