Skip to content

SearchBar fails to show keyboard on Android after coming back from the background #134965

@AndreHaueisen

Description

@AndreHaueisen

Is there an existing issue for this?

Steps to reproduce

  1. Click the SearchBar. They keyboard will come up
  2. Send the app to the background
  3. Come back from the background
  4. Click the SearchBar. The keyboard will not show

Extra info:
I tested on two Android devices. On my Pixel 2 running Android 11 everything worked fine. The problem happened on my Pixel 6 running Android 13

Expected results

When I come back from the background, I expect to see the keyboard again, or at least that it shows again if I click the SearchBar.

Actual results

I can't call the keyboard back

Code sample

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const Scaffold(
        body: Center(child: SearchBar()),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

https://drive.google.com/file/d/14rhlifS67w9rBBkJvMrqFUFonAoB8vOa/view?usp=sharing

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.13.4, on macOS 13.5.2 22G91 darwin-arm64
    (Rosetta), locale en-BR)
[!] Android toolchain - develop for Android devices (Android SDK version
    33.0.0-rc1)
    ✗ 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.1)
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] IntelliJ IDEA Community Edition (version 2023.2.2)
[✓] VS Code (version 1.80.1)
[✓] Connected device (4 available)
[✓] Network resources

Metadata

Metadata

Labels

P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsf: material designflutter/packages/flutter/material repository.found in release: 3.13Found to occur in 3.13found in release: 3.14Found to occur in 3.14frameworkflutter/packages/flutter repository. See also f: labels.fyi-frameworkFor the attention of Framework teamhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions