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

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

Closed
flrnsbt opened this issue May 16, 2024 · 18 comments · Fixed by #148988
Closed
Assignees
Labels
a: text input Entering text in a text field or keyboard related problems c: regression It was better in the past than it is now found in release: 3.22 Found to occur in 3.22 fyi-web For the attention of Web platform team has reproducible steps The issue has been confirmed reproducible and is ready to work on P3 Issues that are less important to the Flutter project platform-linux Building on or for Linux specifically platform-web Web applications specifically r: fixed Issue is closed as already fixed in a newer version team-text-input Owned by Text Input team triaged-text-input Triaged by Text Input team

Comments

@flrnsbt
Copy link

flrnsbt commented May 16, 2024

Steps to reproduce

Use the numeric keypad with any EditableText widget

Expected results

Numbers should be correctly entered in the field, instead an error is thrown.
This only happens with digits from the numeric keypad.

Actual results

The following assertion was thrown during a platform message callback:
Assertion failed:
file:///home/something/flutter/packages/flutter/lib/src/services/hardware_keyboard.dart:505:16
!_pressedKeys.containsKey(event.physicalKey)
"A KeyDownEvent is dispatched, but the state shows that the physical key is already pressed. If this
occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please
ensure that simulated events follow Flutter's event model as documented in `HardwareKeyboard`. This
was the event: KeyDownEvent#ea691(physicalKey: PhysicalKeyboardKey#70059(usbHidUsage:
\"0x00070059\", debugName: \"Numpad 1\"), logicalKey: LogicalKeyboardKey#00cb9(keyId:
\"0x200000231\", keyLabel: \"Numpad 1\", debugName: \"Numpad 1\"), character: \"1\", timeStamp:
0:02:48.590899)"

Code sample

Code sample
[Paste your code here]

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.22.0, on Ubuntu 23.10 6.5.0-35-generic, locale en_US.UTF-8)
    • Flutter version 3.22.0 on channel stable at /home/florian/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5dcb86f68f (7 days ago), 2024-05-09 07:39:20 -0500
    • Engine revision f6344b75dc
    • Dart version 3.4.0
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/florian/Android/Sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /home/florian/Android/Sdk
    • Java binary at: /home/florian/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 16.0.6 (15)
    • cmake version 3.27.4
    • ninja version 1.11.1
    • pkg-config version 1.8.1

[!] Android Studio (version unknown)
    • Android Studio at /home/florian/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to determine Android Studio version.
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.89.1)
    • VS Code at /snap/code/current/usr/share/code
    • Flutter extension version 3.88.0

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 23.10 6.5.0-35-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 124.0.6367.207

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.
@flrnsbt flrnsbt changed the title Bug while pressing Numeric Keypad key on web Bug while pressing Numeric Keypad keys on web with Flutter last stable version May 16, 2024
@darshankawar darshankawar added the in triage Presently being triaged by the triage team label May 16, 2024
@flrnsbt
Copy link
Author

flrnsbt commented May 16, 2024

After several attempts:
Only number 5 works, the others keys: move the field cursor, despite the numeric lock ON.

Traditional number keys work as expected, this is only happening with the Numeric Keypad.

@darshankawar
Copy link
Member

Thanks for the report @flrnsbt
I am unable to replicate this on macOS. Are you using physical keyboard to input numeric data ?

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 16, 2024
@flrnsbt
Copy link
Author

flrnsbt commented May 16, 2024

Yes I'm using a physical keyboard

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 16, 2024
@flrnsbt
Copy link
Author

flrnsbt commented May 16, 2024

Only tested on Web.
I've created a new blank project with just a TextField() and I can reproduce it.

@flrnsbt
Copy link
Author

flrnsbt commented May 16, 2024

That was working perfectly fine before I upgrade flutter. It was working on 3.16.9

@flrnsbt
Copy link
Author

flrnsbt commented May 16, 2024

I can reproduce it on web chrome or firefox with this code:

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      builder: (context, child) {
        return const _Test();
      },
    );
  }
}

class _Test extends StatelessWidget {
  const _Test({super.key});

  @override
  Widget build(BuildContext context) {
    return const Scaffold(body: Center(child: TextField()));
  }
}

@flrnsbt
Copy link
Author

flrnsbt commented May 16, 2024

It seems that if any key other than 012346789 is pressed while pressing a digit key it works.
i.e. if i press and hold the key 'a', and press '4' on the numeric keypard, I will get 'a4'
If I press '4' alone, I get nothing

@fernandomoraesvr
Copy link

Maybe related? #148406

@darshankawar
Copy link
Member

Thanks for the update @flrnsbt
Can you also switch to latest master and re-run your scenario to check if it still persists in it as well ?

flutter channel master
flutter upgrade

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 17, 2024
@flrnsbt
Copy link
Author

flrnsbt commented May 17, 2024

I've just tried it, but the problem is still there.

[✓] Flutter (Channel master, 3.22.0-36.0.pre.37, on Ubuntu 23.10 6.5.0-35-generic, locale en_US.UTF-8)
    • Flutter version 3.22.0-36.0.pre.37 on channel master at /home/florian/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7f32df4218 (21 minutes ago), 2024-05-17 01:57:22 -0400
    • Engine revision d575e511f9
    • Dart version 3.5.0 (build 3.5.0-164.0.dev)
    • DevTools version 2.36.0-dev.10

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/florian/Android/Sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /home/florian/Android/Sdk
    • Java binary at: /home/florian/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 16.0.6 (15)
    • cmake version 3.27.4
    • ninja version 1.11.1
    • pkg-config version 1.8.1

[!] Android Studio (version unknown)
    • Android Studio at /home/florian/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to determine Android Studio version.
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.89.1)
    • VS Code at /snap/code/current/usr/share/code
    • Flutter extension version 3.88.0

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 23.10 6.5.0-35-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 124.0.6367.207

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 17, 2024
@flrnsbt
Copy link
Author

flrnsbt commented May 17, 2024

It seems to be web-specific, as native Linux doesn't have this issue.

@darshankawar
Copy link
Member

Thanks for the update. I tried running sample TextField() on web using mac desktop and entering numeric data using physical keyboard, but didn't observed the reported error.

Screenshot 2024-05-17 at 4 12 39 PM

Looks like it is specific to Linux + chrome setup. Also, going by @flrnsbt's observation that it didn't occur in previous stable (3.19.6) but occuring in 3.22.0, I'll label this as regression and for team's input / attention.

@darshankawar darshankawar changed the title Bug while pressing Numeric Keypad keys on web with Flutter last stable version [Linux][Web]: Bug while pressing Numeric Keypad keys on web with Flutter last stable version May 17, 2024
@darshankawar darshankawar added a: text input Entering text in a text field or keyboard related problems c: regression It was better in the past than it is now platform-web Web applications specifically platform-linux Building on or for Linux specifically team-web Owned by Web platform team engine flutter/engine repository. See also e: labels. and removed in triage Presently being triaged by the triage team labels May 17, 2024
@justinmc justinmc added P3 Issues that are less important to the Flutter project triaged-text-input Triaged by Text Input team labels May 17, 2024
@flutter-triage-bot
Copy link

The triaged-text-input label is irrelevant if there is no team-text-input label or fyi-text-input label.

@flutter-triage-bot flutter-triage-bot bot removed the triaged-text-input Triaged by Text Input team label May 17, 2024
@slgobinath
Copy link

Confirming the bug in Linux Web (both Chrome and Firefox). Couldn't reproduce in MacBook.

@adonisRodxander
Copy link

Same issue Linux+Chrome v3.22.0

@huycozy
Copy link
Member

huycozy commented May 20, 2024

I can't reproduce the error above but I can see the result at #148447 (comment) on my Linux machine in which only 0 and 5 keys are written out (same result to a deduplicated issue at #148544).

I reproduced this on Flutter Web target platform with a keyboard with numpad keys. This doesn't occur on Flutter Linux app and Flutter Web target on macOS machine.

The issue doesn't appear on the previous Flutter stable release 3.19.6.

flutter doctor -v (stable & master)
[✓] Flutter (Channel stable, 3.22.0, on Ubuntu 22.04.3 LTS 6.5.0-26-generic, locale en_US.UTF-8)
    • Flutter version 3.22.0 on channel stable at /home/huynq/Documents/Working/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5dcb86f68f (11 days ago), 2024-05-09 07:39:20 -0500
    • Engine revision f6344b75dc
    • Dart version 3.4.0
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc3)
    • Android SDK at /home/huynq/Android/Sdk/
    • Platform android-33, build-tools 34.0.0-rc3
    • Java binary at: /snap/android-studio/current/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 14.0.0-1ubuntu1.1
    • cmake version 3.22.1
    • ninja version 1.10.1
    • pkg-config version 0.29.2

[✓] Android Studio (version 2021.1)
    • Android Studio at /home/huynq/Documents/android-studio
    • Flutter plugin version 67.0.1
    • Dart plugin version 211.7817
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)

[!] Android Studio (version unknown)
    • Android Studio at /snap/android-studio/current
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to determine Android Studio version.
    • android-studio-dir = /snap/android-studio/current
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)

[✓] VS Code (version 1.84.2)
    • VS Code at /usr/share/code
    • Flutter extension version 3.86.0

[✓] VS Code (version 1.88.1)
    • VS Code at /snap/code/current/usr/share/code
    • Flutter extension version 3.86.0

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 22.04.3 LTS 6.5.0-26-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 120.0.6099.199

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.
[!] Flutter (Channel master, 3.22.0-36.0.pre.54, on Ubuntu 22.04.3 LTS 6.5.0-26-generic, locale en_US.UTF-8)
    • Flutter version 3.22.0-36.0.pre.54 on channel master at /home/huynq/Documents/Working/flutter_master
    ! Warning: `flutter` on your path resolves to /home/huynq/Documents/Working/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /home/huynq/Documents/Working/flutter_master. Consider adding /home/huynq/Documents/Working/flutter_master/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /home/huynq/Documents/Working/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /home/huynq/Documents/Working/flutter_master. Consider adding /home/huynq/Documents/Working/flutter_master/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 414d923872 (3 hours ago), 2024-05-19 21:58:34 -0400
    • Engine revision c6fecf65fb
    • Dart version 3.5.0 (build 3.5.0-169.0.dev)
    • DevTools version 2.36.0-dev.10
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc3)
    • Android SDK at /home/huynq/Android/Sdk/
    • Platform android-33, build-tools 34.0.0-rc3
    • Java binary at: /snap/android-studio/current/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 14.0.0-1ubuntu1.1
    • cmake version 3.22.1
    • ninja version 1.10.1
    • pkg-config version 0.29.2

[✓] Android Studio (version 2021.1)
    • Android Studio at /home/huynq/Documents/android-studio
    • Flutter plugin version 67.0.1
    • Dart plugin version 211.7817
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)

[!] Android Studio (version unknown)
    • Android Studio at /snap/android-studio/current
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to determine Android Studio version.
    • android-studio-dir = /snap/android-studio/current
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)

[✓] VS Code (version 1.84.2)
    • VS Code at /usr/share/code
    • Flutter extension version 3.88.0

[✓] VS Code (version 1.88.1)
    • VS Code at /snap/code/current/usr/share/code
    • Flutter extension version 3.88.0

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 22.04.3 LTS 6.5.0-26-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 120.0.6099.199

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 2 categories.

Updating issue's labels as it seems more of a text input than web issue but still forward information to web team.

@huycozy huycozy added has reproducible steps The issue has been confirmed reproducible and is ready to work on fyi-web For the attention of Web platform team team-text-input Owned by Text Input team triaged-text-input Triaged by Text Input team found in release: 3.22 Found to occur in 3.22 and removed team-web Owned by Web platform team labels May 20, 2024
@bhuphathi
Copy link

bhuphathi commented May 20, 2024

@darshankawar
@danagbemava-nc
@bleroux

Numeric keys from Numpad in web app in linux web browsers only not working this is because after this PR #145464

bug after this commit hash: 859eb2e

numeric keys work in linux web, if using previous commit: 5fab92f

file path: flutter/lib/src/widgets/default_text_editing_shortcuts.dart

line No: 255 to 297

  static final Map<ShortcutActivator, Intent> _linuxNumpadShortcuts = <ShortcutActivator, Intent>{
    // When numLock is on, numpad keys shortcuts require shift to be pressed too.
    const SingleActivator(LogicalKeyboardKey.numpad6, shift: true, numLock: LockState.locked): const ExtendSelectionByCharacterIntent(forward: true, collapseSelection: false),
    const SingleActivator(LogicalKeyboardKey.numpad4, shift: true, numLock: LockState.locked): const ExtendSelectionByCharacterIntent(forward: false, collapseSelection: false),
    const SingleActivator(LogicalKeyboardKey.numpad8, shift: true, numLock: LockState.locked): const ExtendSelectionVerticallyToAdjacentLineIntent(forward: false, collapseSelection: false),
    const SingleActivator(LogicalKeyboardKey.numpad2, shift: true, numLock: LockState.locked): const ExtendSelectionVerticallyToAdjacentLineIntent(forward: true, collapseSelection: false),

    const SingleActivator(LogicalKeyboardKey.numpad6, shift: true, control: true, numLock: LockState.locked): const ExtendSelectionToNextWordBoundaryIntent(forward: true, collapseSelection: false),
    const SingleActivator(LogicalKeyboardKey.numpad4, shift: true, control: true, numLock: LockState.locked): const ExtendSelectionToNextWordBoundaryIntent(forward: false, collapseSelection: false),
    const SingleActivator(LogicalKeyboardKey.numpad8, shift: true, control: true, numLock: LockState.locked): const ExtendSelectionToNextParagraphBoundaryIntent(forward: false, collapseSelection: false),
    const SingleActivator(LogicalKeyboardKey.numpad2, shift: true, control: true, numLock: LockState.locked): const ExtendSelectionToNextParagraphBoundaryIntent(forward: true, collapseSelection: false),

    const SingleActivator(LogicalKeyboardKey.numpad9, shift: true, numLock: LockState.locked): const ExtendSelectionVerticallyToAdjacentPageIntent(forward: false, collapseSelection: false),
    const SingleActivator(LogicalKeyboardKey.numpad3, shift: true, numLock: LockState.locked): const ExtendSelectionVerticallyToAdjacentPageIntent(forward: true, collapseSelection: false),

    const SingleActivator(LogicalKeyboardKey.numpad7, shift: true, numLock: LockState.locked): const ExtendSelectionVerticallyToAdjacentLineIntent(forward: false, collapseSelection: false),
    const SingleActivator(LogicalKeyboardKey.numpad1, shift: true, numLock: LockState.locked): const ExtendSelectionVerticallyToAdjacentLineIntent(forward: true, collapseSelection: false),

    const SingleActivator(LogicalKeyboardKey.numpadDecimal, shift: true, numLock: LockState.locked): const DeleteCharacterIntent(forward: true),
    const SingleActivator(LogicalKeyboardKey.numpadDecimal, shift: true, control: true, numLock: LockState.locked): const DeleteToNextWordBoundaryIntent(forward: true),

    // When numLock is off, numpad keys shortcuts require shift not to be pressed.
    const SingleActivator(LogicalKeyboardKey.numpad6, numLock: LockState.unlocked): const ExtendSelectionByCharacterIntent(forward: true, collapseSelection: true),
    const SingleActivator(LogicalKeyboardKey.numpad4, numLock: LockState.unlocked): const ExtendSelectionByCharacterIntent(forward: false, collapseSelection: true),
    const SingleActivator(LogicalKeyboardKey.numpad8, numLock: LockState.unlocked): const ExtendSelectionVerticallyToAdjacentLineIntent(forward: false, collapseSelection: true),
    const SingleActivator(LogicalKeyboardKey.numpad2, numLock: LockState.unlocked): const ExtendSelectionVerticallyToAdjacentLineIntent(forward: true, collapseSelection: true),

    const SingleActivator(LogicalKeyboardKey.numpad6, control: true, numLock: LockState.unlocked): const ExtendSelectionToNextWordBoundaryIntent(forward: true, collapseSelection: true),
    const SingleActivator(LogicalKeyboardKey.numpad4, control: true, numLock: LockState.unlocked): const ExtendSelectionToNextWordBoundaryIntent(forward: false, collapseSelection: true),
    const SingleActivator(LogicalKeyboardKey.numpad8, control: true, numLock: LockState.unlocked): const ExtendSelectionToNextParagraphBoundaryIntent(forward: false, collapseSelection: true),
    const SingleActivator(LogicalKeyboardKey.numpad2, control: true, numLock: LockState.unlocked): const ExtendSelectionToNextParagraphBoundaryIntent(forward: true, collapseSelection: true),

    const SingleActivator(LogicalKeyboardKey.numpad9, numLock: LockState.unlocked): const ExtendSelectionVerticallyToAdjacentPageIntent(forward: false, collapseSelection: true),
    const SingleActivator(LogicalKeyboardKey.numpad3, numLock: LockState.unlocked): const ExtendSelectionVerticallyToAdjacentPageIntent(forward: true, collapseSelection: true),

    const SingleActivator(LogicalKeyboardKey.numpad7, numLock: LockState.unlocked): const ExtendSelectionVerticallyToAdjacentLineIntent(forward: false, collapseSelection: true),
    const SingleActivator(LogicalKeyboardKey.numpad1, numLock: LockState.unlocked): const ExtendSelectionVerticallyToAdjacentLineIntent(forward: true, collapseSelection: true),

    const SingleActivator(LogicalKeyboardKey.numpadDecimal, numLock: LockState.unlocked): const DeleteCharacterIntent(forward: true),
    const SingleActivator(LogicalKeyboardKey.numpadDecimal, control: true, numLock: LockState.unlocked): const DeleteToNextWordBoundaryIntent(forward: true),
  };

@bleroux bleroux self-assigned this May 20, 2024
@LimaneGaya
Copy link

Seems that when starting the app with numLock off then turning it on everything works fine.
It also displays numbers when numLock is on and doing combinaison of numLock + keypadNumber.

I managed to make things work as expected by editing the line at 140 in file
raw_keyboard_web.dart

 @override
  bool isModifierPressed(ModifierKey key, {KeyboardSide side = KeyboardSide.any}) {
    return isPressed = switch (key) {
      ModifierKey.controlModifier    => metaState & modifierControl != 0,
      ModifierKey.shiftModifier      => metaState & modifierShift != 0,
      ModifierKey.altModifier        => metaState & modifierAlt != 0,
      ModifierKey.metaModifier       => metaState & modifierMeta != 0,
      ModifierKey.numLockModifier    => true,
      ModifierKey.capsLockModifier   => metaState & modifierCapsLock != 0,
      ModifierKey.scrollLockModifier => metaState & modifierScrollLock != 0,
      // On Web, the browser doesn't report the state of the FN and SYM modifiers.
      ModifierKey.functionModifier || ModifierKey.symbolModifier => false,
    };
  }

But i get this exception:
Another exception was thrown: Unsupported operation: Platform._operatingSystem

@jonahwilliams jonahwilliams removed the engine flutter/engine repository. See also e: labels. label May 20, 2024
auto-submit bot pushed a commit that referenced this issue May 25, 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.
@bleroux bleroux added the r: fixed Issue is closed as already fixed in a newer version label May 26, 2024
victorsanni pushed a commit to victorsanni/flutter that referenced this issue 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.
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 c: regression It was better in the past than it is now found in release: 3.22 Found to occur in 3.22 fyi-web For the attention of Web platform team has reproducible steps The issue has been confirmed reproducible and is ready to work on P3 Issues that are less important to the Flutter project platform-linux Building on or for Linux specifically platform-web Web applications specifically r: fixed Issue is closed as already fixed in a newer version team-text-input Owned by Text Input team triaged-text-input Triaged by Text Input team
Projects
Status: Done (PR merged)
Development

Successfully merging a pull request may close this issue.