Skip to content

DatePickerDialog text input causes keyboard to open and close on a 480p Android emulator. #140311

Description

@manu-sncf

Steps to reproduce

  1. Create an Android emulator with WVGA (480x800hdpi),
  2. In system settings, set font size to mini,

Screenshot_1702891450

  1. In basic MaterialApp widget, call showDatePicker,
  2. Switch to input mode.

This issue can be reproduced on iOS too.

Expected results

A date picker dialog with focused textfield and keyboard displayed.

Screenshot_1702890661

Actual results

A date picker dialog without textfield and keyboard.

Flutter 3.16.4 :
Screenshot_1702891112

Fluter 3.13.8 :
Screenshot_1702899256

Code sample

Code sample
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) {
    const datepickerDemo = 'Date Picker Demo';
    final now = DateTime.now();

    return MaterialApp(
      title: datepickerDemo,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: Scaffold(
        appBar: AppBar(
          backgroundColor: Theme.of(context).colorScheme.inversePrimary,
          title: const Text(datepickerDemo),
        ),
        body: Center(
          child: Builder(
              builder: (context) => ElevatedButton(
                    onPressed: () {
                      showDatePicker(
                        context: context,
                        initialDate: now,
                        firstDate: now,
                        lastDate: now.add(const Duration(days: 365)),
                      );
                    },
                    child: const Text('Show date picker'),
                  )),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

datepicker

Logs

No response

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.16.4, on macOS 14.1.2 23B92 darwin-arm64, locale fr-FR)
    • Flutter version 3.16.4 on channel stable at /Users/manu/fvm/versions/3.16.4
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2e9cb0aa71 (7 days ago), 2023-12-11 14:35:13 -0700
    • Engine revision 54a7145303
    • Dart version 3.2.3
    • DevTools version 2.28.4

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/manu/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15C65
    • CocoaPods version 1.14.3

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

[✓] Android Studio (version 2022.2)
    • 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
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] IntelliJ IDEA Ultimate Edition (version 2023.3.1)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • 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

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

[✓] Connected device (4 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64  • Android 13 (API 33) (emulator)
    • sdk gphone64 arm64 (mobile) • emulator-5556 • android-arm64  • Android 13 (API 33) (emulator)
    • macOS (desktop)             • macos         • darwin-arm64   • macOS 14.1.2 23B92 darwin-arm64
    • Chrome (web)                • chrome        • web-javascript • Google Chrome 120.0.6099.109
    ! Error: Browsing on the local area network for iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

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

• No issues found!

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work liste: device-specificOnly manifests on certain devicesf: date/time pickerDate or time picker widgetsf: material designflutter/packages/flutter/material repository.found in release: 3.16Found to occur in 3.16found in release: 3.18Found to occur in 3.18frameworkflutter/packages/flutter repository. See also f: labels.has 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
No fields configured for issues without a type.

Projects

Status
Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions