Skip to content

[Android TV][TextField] Soft keyboard is not responsive once text field received focus #125541

Closed

Description

@sck-v

Is there an existing issue for this?

Steps to reproduce

  1. Run sample app on a real device - emulator seems to be working fine and looks like only certain devices are affected
  2. Use d-pad to gain focus on a text field
  3. Activate it, ensure keyboard is opened
  4. Try to navigate through keyboard
  5. Flutter activity still have focus and d-pad is navigating through elements behind keyboard
IMG_1835.MOV

Actual results

Soft keyboard should be navigable

Logs

Logs
<!-- Paste your logs here -->

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel stable, 3.7.11, on macOS 13.3.1 22E261 darwin-x64, locale ru)
    ! Warning: `dart` on your path resolves to /usr/local/Cellar/dart/2.15.1/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/ivan_kryak/fvm/versions/3.7.11. Consider adding /Users/ivan_kryak/fvm/versions/3.7.11/bin to the front of your path.
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] VS Code (version 1.77.3)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

! Doctor found issues in 2 categories.
</details>

Activity

  1. added
    in triage
    on Apr 26, 2023
  2. huycozy commented on Apr 26, 2023

    @huycozy
    Member

    Hi @sck-v
    What is your TV model? Do you notice any special logs from the console output?

    Also, can you please check this on the latest Flutter master channel? Thanks!

  3. added
    waiting for response
    on Apr 26, 2023
  4. sck-v commented on Apr 27, 2023

    @sck-v
    Author

    We have multiple reports from various of devices, so no exact correlation here

    • Direct TV Stream box
    • Google Chromecast
    • Sony BRAVIA, Model 55A805
    • LG, Model 24LM520S-WU / webOS TV Version 3.8.0-6140301 (dreadlocks2-dunggir)

    I will check master branch and get back to you

  5. removed
    waiting for response
    on Apr 27, 2023
  6. huycozy commented on Apr 27, 2023

    @huycozy
    Member

    Unfortunately, I don't have any similar device to test this. Can you please also check this on an Android native project with simple EditText?

  7. added
    waiting for response
    on Apr 27, 2023
  8. sck-v commented on Apr 27, 2023

    @sck-v
    Author

    The workaround we ended up with is using native Android controls via Platform Views, so I can confirm that native controls work

  9. removed
    waiting for response
    on Apr 27, 2023
  10. huycozy commented on Apr 28, 2023

    @huycozy
    Member

    When listening the key events from d-pad (Android TV emulator), I notice events are not reported with d-pad input but with host machine keyboard input (macOS). There are only events when entering/existing the keyboard but not with input events or arrow keys.

    Demo - Android TV emulator
    Screen.Recording.2023-04-28.at.13.19.28.mp4

    Can you please try below sample code and notice if you can see d-pad input key events from the console?

    Sample code
    import 'package:flutter/material.dart';
    import 'package:flutter/services.dart';
    
    void main() {
      WidgetsFlutterBinding.ensureInitialized();
      RawKeyboard.instance.addListener((e) {
        debugPrint('${e.character} - ${e.logicalKey} - ${e.physicalKey}');
      });
      runApp(const MyApp());
    }
    
    class MyApp extends StatefulWidget {
      const MyApp({Key? key}) : super(key: key);
    
      @override
      State<MyApp> createState() => _MyAppState();
    }
    
    class _MyAppState extends State<MyApp> {
    
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          home: Scaffold(
            body: Center(
              child: Container(
                margin: const EdgeInsets.all(20),
                child:
                const TextField(
                  decoration: InputDecoration.collapsed(hintText: 'Enter'),
                ),
              ),
            ),
          ),
        );
      }
    }
  11. added
    waiting for response
    on Apr 28, 2023
  12. github-actions commented on May 19, 2023

    @github-actions

    Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
    If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
    Thanks for your contribution.

  13. github-actions commented on Jun 2, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  14. locked as resolved and limited conversation to collaborators on Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in triagewaiting for response

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions