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

[android] keyboard type doesn't change on some keyboards #88299

Open
tbm98 opened this issue Aug 16, 2021 · 6 comments
Open

[android] keyboard type doesn't change on some keyboards #88299

tbm98 opened this issue Aug 16, 2021 · 6 comments
Labels
a: text input Entering text in a text field or keyboard related problems f: material design flutter/packages/flutter/material repository. found in release: 2.2 Found to occur in 2.2 found in release: 2.5 Found to occur in 2.5 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-android Android applications specifically team-android Owned by Android platform team triaged-android Triaged by Android platform team

Comments

@tbm98
Copy link
Contributor

tbm98 commented Aug 16, 2021

Steps to Reproduce

use two TextField with different textInputAction

one has maxLines: null and textInputAction: TextInputAction.done
another one has maxLines: null and textInputAction: TextInputAction.newline

Expected results: action button on keyboard display correct action

Actual results: action button on keyboard display the same action for both

flutter doctor -v

Details

[✓] Flutter (Channel stable, 2.2.3, on macOS 11.4 20F71 darwin-x64, locale en)
    • Flutter version 2.2.3 at /Users/minhtran/fvm/versions/stable
    • Framework revision f4abaa0735 (7 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/minhtran/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at:
      /Library/Java/JavaVirtualMachines/jdk-11.0.12.jdk/Contents/Home/bin/java
    • Java version Java(TM) SE Runtime Environment 18.9 (build
      11.0.12+8-LTS-237)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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 find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] IntelliJ IDEA Community Edition (version 2021.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 59.0.4
    • Dart plugin version 212.4746.57

[✓] VS Code (version 1.59.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.25.0

[✓] Connected device (3 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86    •
      Android 11 (API 30) (emulator)
    • macOS (desktop)                    • macos         • darwin-x64     •
      macOS 11.4 20F71 darwin-x64
    • Chrome (web)                       • chrome        • web-javascript •
      Google Chrome 92.0.4515.131

! Doctor found issues in 1 category.

sample snippet

Details
    return Scaffold(
      appBar: AppBar(
        leading: const BackButton(),
        actions: [IconButton(onPressed: () {}, icon: Icon(Icons.alarm))],
      ),
      body: Container(
        child: SingleChildScrollView(
          child: Padding(
            padding: const EdgeInsets.all(16),
            child: Column(
              mainAxisSize: MainAxisSize.min,
              children: const [
                TextField(
                  decoration: InputDecoration(
                    hintText: 'Title',
                    border: InputBorder.none,
                  ),
                  maxLines: null,
                  style: TextStyle(fontSize: 24),
                  textInputAction: TextInputAction.done,
                ),
                TextField(
                  decoration: InputDecoration(
                    hintText: 'Note',
                    border: InputBorder.none,
                  ),
                  maxLines: null,
                  textInputAction: TextInputAction.newline,
                ),
              ],
            ),
          ),
        ),
      ),
    );

full code: here
run app > click to add(+) button

Screen.Recording.2021-08-16.at.23.58.43.mov
@TahaTesser TahaTesser added the in triage Presently being triaged by the triage team label Aug 17, 2021
@TahaTesser
Copy link
Member

Hi @tbm98
Thanks for filing the issue, I am not able to reproduce the issue on emulators on macOS or Windows (Android 10 or Android 11)

macOS

Screen.Recording.2021-08-17.at.13.41.27.mov

Windows

ezgif com-gif-maker

I also tried a physical device with Google Gboard, still no issue

but it reproduces when using SwiftKey

flutter doctor -v
[✓] Flutter (Channel stable, 2.2.3, on Microsoft Windows [Version 10.0.22000.132], locale en-US)
    • Flutter version 2.2.3 at C:\Users\Taha\Code\flutter_stable
    • Framework revision f4abaa0735 (7 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\Taha\Code\android-sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_SDK_ROOT = C:\Users\Taha\Code\android-sdk
    • Java binary at: C:\Users\Taha\Code\android-studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[✓] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.0)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31605.320
    • Windows 10 SDK version 10.0.19041.0

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

[✓] VS Code (version 1.59.0)
    • VS Code at C:\Users\Taha\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.25.0

[✓] Connected device (6 available)
    • Redmi K20 Pro (mobile)             • def0ad20      • android-arm64  • Android 11 (API 30)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86    • Android 10 (API 29) (emulator)
    • sdk gphone x86 (mobile)            • emulator-5556 • android-x86    • Android 11 (API 30) (emulator)
    • Windows (desktop)                  • windows       • windows-x64    • Microsoft Windows [Version 10.0.22000.132]
    • Chrome (web)                       • chrome        • web-javascript • Google Chrome 92.0.4515.159
    • Edge (web)                         • edge          • web-javascript • Microsoft Edge 92.0.902.67

! Doctor found issues in 1 category.

Can you please provide the exact emulator name from AVD manger?

@TahaTesser TahaTesser added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 17, 2021
@tbm98
Copy link
Contributor Author

tbm98 commented Aug 17, 2021

Hi @TahaTesser
It is pixel 4 XL with android 11 (without google play)

preview Screen Shot 2021-08-17 at 21 59 59 Screen Shot 2021-08-17 at 22 00 09

I just tested on pixel 4 with android 11(with google play) it works correctly

@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 Aug 17, 2021
@TahaTesser
Copy link
Member

TahaTesser commented Aug 18, 2021

Hi @tbm98
I can reproduce on the same emulator, the reason for this is emulator without Google Play uses the AOSP keyboard, and with Google Play emulator uses Gboard. It is confirmed by reproduction on physical which uses Gboard #88299 (comment). But the issue also exists on the Swift keyboard.

Also If use either of the text fields without a column, it works fine

Preview
Capture

Emulator with AOSP keyboard

[   +5 ms] Flutter run key commands.
[   +3 ms] r Hot reload. 🔥🔥🔥
[   +2 ms] R Hot restart.
[   +1 ms] h List all available interactive commands.
[   +1 ms] d Detach (terminate "flutter run" but leave application running).
[   +1 ms] c Clear the screen
[        ] q Quit (terminate the application on the device).
[        ] 💪 Running with sound null safety 💪
[   +1 ms] An Observatory debugger and profiler on Android SDK built for x86 is available at:
http://127.0.0.1:51355/Kdww_voqWPU=/
[ +204 ms] DevTools activation throttled until 2021-08-18 22:33:18.358733.
[+3147 ms] The Flutter DevTools debugger and profiler on Android SDK built for x86 is available at:
                    http://127.0.0.1:9101?uri=http://127.0.0.1:51355/Kdww_voqWPU=/
[+8986 ms] W/IInputConnectionWrapper( 3786): getSelectedText on inactive InputConnection
[   +1 ms] W/IInputConnectionWrapper( 3786): requestCursorAnchorInfo on inactive InputConnection
[   +1 ms] W/IInputConnectionWrapper( 3786): getTextBeforeCursor on inactive InputConnection
[   +3 ms] W/IInputConnectionWrapper( 3786): getTextBeforeCursor on inactive InputConnection
[ +175 ms] W/IInputConnectionWrapper( 3786): getTextBeforeCursor on inactive InputConnection
[        ] W/IInputConnectionWrapper( 3786): getTextBeforeCursor on inactive InputConnection
[ +160 ms] D/InputConnectionAdaptor( 3786): The input method toggled cursor monitoring on
[ +423 ms] D/InputConnectionAdaptor( 3786): The input method toggled cursor monitoring on
[ +405 ms] D/InputConnectionAdaptor( 3786): The input method toggled cursor monitoring on
[ +422 ms] D/InputConnectionAdaptor( 3786): The input method toggled cursor monitoring on
[ +300 ms] D/InputConnectionAdaptor( 3786): The input method toggled cursor monitoring on
[ +323 ms] D/InputConnectionAdaptor( 3786): The input method toggled cursor monitoring on
[ +227 ms] D/InputConnectionAdaptor( 3786): The input method toggled cursor monitoring on
[ +240 ms] D/InputConnectionAdaptor( 3786): The input method toggled cursor monitoring on
stable master

Check flutter doctor -v outputs for each channel below

flutter doctor -v
[✓] Flutter (Channel stable, 2.2.3, on Microsoft Windows [Version 10.0.22000.132], locale en-US)
    • Flutter version 2.2.3 at C:\Users\Taha\Code\flutter_stable
    • Framework revision f4abaa0735 (7 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\Taha\Code\android-sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_SDK_ROOT = C:\Users\Taha\Code\android-sdk
    • Java binary at: C:\Users\Taha\Code\android-studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[✓] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.0)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31605.320
    • Windows 10 SDK version 10.0.19041.0

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

[✓] VS Code (version 1.59.0)
    • VS Code at C:\Users\Taha\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.25.0

[✓] Connected device (5 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • sdk gphone x86 (mobile)            • emulator-5556 • android-x86    • Android 11 (API 30) (emulator)
    • Windows (desktop)                  • windows       • windows-x64    • Microsoft Windows [Version 10.0.22000.132]
    • Chrome (web)                       • chrome        • web-javascript • Google Chrome 92.0.4515.159
    • Edge (web)                         • edge          • web-javascript • Microsoft Edge 92.0.902.67

! Doctor found issues in 1 category.
[✓] Flutter (Channel master, 2.5.0-7.0.pre.130, on Microsoft Windows [Version 10.0.22000.132], locale en-US)
    • Flutter version 2.5.0-7.0.pre.130 at C:\Users\Taha\Code\flutter_master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d83fba1a22 (54 minutes ago), 2021-08-18 03:02:04 -0400
    • Engine revision a27da3eeb6
    • Dart version 2.15.0 (build 2.15.0-24.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\Taha\Code\android-sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_SDK_ROOT = C:\Users\Taha\Code\android-sdk
    • Java binary at: C:\Users\Taha\Code\android-studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[✓] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.0)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31605.320
    • Windows 10 SDK version 10.0.19041.0

[✓] Android Studio (version 2020.3)
    • Android Studio at C:\Users\Taha\Code\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
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code (version 1.59.0)
    • VS Code at C:\Users\Taha\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.25.0

[✓] Connected device (6 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86     • Android 11 (API 30) (emulator)
    • sdk gphone x86 (mobile)            • emulator-5556 • android-x86     • Android 11 (API 30) (emulator)
    • Windows (desktop)                  • windows       • windows-x64     • Microsoft Windows [Version 10.0.22000.132]
    • Windows (UWP) (desktop)            • winuwp        • windows-uwp-x64 •
    • Chrome (web)                       • chrome        • web-javascript  • Google Chrome 92.0.4515.159
    • Edge (web)                         • edge          • web-javascript  • Microsoft Edge 92.0.902.67

• No issues found!

✅: No Issue ❌: Issue reproduced

@TahaTesser TahaTesser changed the title textInputAction does'nt work correct if I put two TextField as children of Column [android] textInputAction doesn't change on keyboards on Android when using different textInputAction types in a column Aug 18, 2021
@TahaTesser TahaTesser added a: text input Entering text in a text field or keyboard related problems engine flutter/engine repository. See also e: labels. found in release: 2.2 Found to occur in 2.2 found in release: 2.5 Found to occur in 2.5 has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-android Android applications specifically and removed in triage Presently being triaged by the triage team labels Aug 18, 2021
@TahaTesser TahaTesser changed the title [android] textInputAction doesn't change on keyboards on Android when using different textInputAction types in a column [android] textInputAction doesn't change on sone keyboards on Android when using different textInputAction types in a column Aug 18, 2021
@TahaTesser TahaTesser changed the title [android] textInputAction doesn't change on sone keyboards on Android when using different textInputAction types in a column [android] textInputAction doesn't change on some keyboards on Android when using different textInputAction types in a column Aug 18, 2021
@HansMuller HansMuller added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Aug 18, 2021
@HansMuller
Copy link
Contributor

CC @justinmc

@justinmc
Copy link
Contributor

Vaguely reminds me of #84240, but I guess that's keyboard type and not action...

@chinmaygarde chinmaygarde removed the engine flutter/engine repository. See also e: labels. label Aug 23, 2021
@TahaTesser TahaTesser added this to To do in Nevercode via automation Dec 1, 2021
@TahaTesser TahaTesser changed the title [android] textInputAction doesn't change on some keyboards on Android when using different textInputAction types in a column [android] keyboard type doesn't change on some keyboards Dec 1, 2021
@TahaTesser
Copy link
Member

@justinmc
I looked into this, I don't see any difference in editable_text when using either keyboard
TextInput._instance._currentConfiguration in text_input.dart is correctly updated with new action and keyboard type.
Do you think this is a framework issue still? I can see input action has changed but the keyboard on the screen is not updated only with the AOSP keyboard

and I also tested the native app with the same configuration, keyboard updates just fine.

@TahaTesser TahaTesser removed this from To do in Nevercode Mar 24, 2022
@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-android Owned by Android platform team labels Jul 8, 2023
@camsim99 camsim99 added P2 Important issues not at the top of the work list triaged-android Triaged by Android platform team labels Jul 20, 2023
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 f: material design flutter/packages/flutter/material repository. found in release: 2.2 Found to occur in 2.2 found in release: 2.5 Found to occur in 2.5 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-android Android applications specifically team-android Owned by Android platform team triaged-android Triaged by Android platform team
Projects
None yet
Development

No branches or pull requests

8 participants
@chinmaygarde @justinmc @Hixie @HansMuller @camsim99 @TahaTesser @tbm98 and others