Skip to content

Flutter OnScreen Keyboard opens on physical key press #51478

@SebastianRuettger

Description

@SebastianRuettger

I have a device that uses a laserscanner to scan barcodes and outputs the result as simulated keypresses. I've used this with a RawKeyboardListener and it worked fine. Since then I've added a login screen to the app, that is only shown if the user hasn't logged in. If the login screen has been shown and disposed the onscreen keyboard opens when i press the physical scanner button. This should not happen and doesn't happen if the login screen hasn't been shown. My guess is, that there still are some remains of the textfields used in the login screen, after it is disposed. I've tried setting the FocusNodes for the Textfields and then disposing them in the dispose method, but that didn't work

I've asked a question on StackOverflow: https://stackoverflow.com/questions/60417173/flutter-onscreen-keyboard-opens-on-physical-key-press

Steps to Reproduce

  1. Screen with one or more Textfields
  2. focus one or more
  3. navigate to new screen
  4. press physical button

Expected results: button is pressed but only the keyevents are fired

Actual results: the onscreen keyboard opens

Logs
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.16299.1686], locale de-DE)
    • Flutter version 1.12.13+hotfix.8 at C:\Users\sruettge\Documents\flutter
    • Framework revision 0b8abb4724 (2 weeks ago), 2020-02-11 11:44:36 -0800
    • Engine revision e1e6ced81d
    • Dart version 2.7.0


[√] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
    • Android SDK at C:\Users\sruettge\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.1
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
    • All Android licenses accepted.

[√] Android Studio (version 3.5)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 36.0.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] VS Code (version 1.42.1)
    • VS Code at C:\Users\sruettge\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.8.1

[√] Connected device (1 available)
    • MEMOR 10 • S19H00332 • android-arm64 • Android 8.1.0 (API 27)

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: text inputEntering text in a text field or keyboard related problemse: device-specificOnly manifests on certain devicesframeworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionteam-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions