Skip to content

Fix date picker flickering#167976

Merged
auto-submit[bot] merged 2 commits into
flutter:masterfrom
bleroux:fix_date_picker_flickering
Apr 29, 2025
Merged

Fix date picker flickering#167976
auto-submit[bot] merged 2 commits into
flutter:masterfrom
bleroux:fix_date_picker_flickering

Conversation

@bleroux

@bleroux bleroux commented Apr 29, 2025

Copy link
Copy Markdown
Contributor

Description

This PR fixes a DatePicker flickering issue observed on some devices with a small display.

Before

When the date picker input dialog is shown the virtual keyboard opens and reduces the available height. The current logic reacts by removing the picker TextField. Because there is no more TextField the virtual keyboard is hidden and the available height increases, at that moment the TextField is shown again. Due to autofocus the virtual keyboard opens which leads to the removal of the TextField and so on.

Enregistrement.de.l.ecran.2025-04-29.a.09.13.52.mov

After

When there is not enough vertical space for the input date picker dialog, the header is hidden instead of hiding the TextField.

Enregistrement.de.l.ecran.2025-04-29.a.09.12.14.mov

Related Issue

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

Tests

Adds 2 tests.

@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Apr 29, 2025
@bleroux bleroux requested a review from TahaTesser April 29, 2025 09:48
Comment thread packages/flutter/test/material/date_picker_test.dart Outdated
Comment thread packages/flutter/test/material/date_range_picker_test.dart Outdated
@github-actions github-actions Bot added the engine flutter/engine related. See also e: labels. label Apr 29, 2025
Comment thread engine/src/out Outdated
@bleroux bleroux force-pushed the fix_date_picker_flickering branch from c026c81 to 060382f Compare April 29, 2025 12:47
@bleroux bleroux force-pushed the fix_date_picker_flickering branch from 060382f to 8307821 Compare April 29, 2025 13:20
@github-actions github-actions Bot removed the engine flutter/engine related. See also e: labels. label Apr 29, 2025

@TahaTesser TahaTesser left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@bleroux bleroux added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 29, 2025
@auto-submit auto-submit Bot added this pull request to the merge queue Apr 29, 2025
Merged via the queue into flutter:master with commit a46bf19 Apr 29, 2025
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Apr 29, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 29, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 29, 2025
@bleroux bleroux deleted the fix_date_picker_flickering branch April 29, 2025 18:52
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 30, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 30, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 1, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 1, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 1, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 1, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 2, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 2, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 3, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 3, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 4, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 14, 2025
romanejaquez pushed a commit to romanejaquez/flutter that referenced this pull request Aug 14, 2025
## Description

This PR fixes a `DatePicker` flickering issue observed on some devices
with a small display.

### Before

When the date picker input dialog is shown the virtual keyboard opens
and reduces the available height. The current logic reacts by removing
the picker `TextField`. Because there is no more `TextField` the virtual
keyboard is hidden and the available height increases, at that moment
the `TextField` is shown again. Due to autofocus the virtual keyboard
opens which leads to the removal of the `TextField` and so on.


https://github.com/user-attachments/assets/deb70f2e-1c8b-47a9-9db6-47bc521e4eb7


### After

When there is not enough vertical space for the input date picker
dialog, the header is hidden instead of hiding the `TextField`.


https://github.com/user-attachments/assets/14051ee9-3b9a-4467-a4a0-4ee91b4979ea



## Related Issue

[Fixes DatePickerDialog text input causes keyboard to open and close on
a 480p Android
emulator](flutter#140311).

## Tests

Adds 2 tests.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants