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

[MaterialDatePicker] Soft input not showing when picker is shown with INPUT_MODE_TEXT #2747

Closed
mialkan opened this issue Jun 10, 2022 · 2 comments

Comments

@mialkan
Copy link

mialkan commented Jun 10, 2022

Description:

When I try to show MaterialDatePicker with input mode text its not showing the soft input keyboard. But If I switch between text and calendar mode it shows soft input. It works for some android devices that I tested. (Android 6, Android 7).

Expected behavior: Soft Input should be shown when MaterialDatePicker opened with input mode text.

Source code:

public static void requestFocusAndShowKeyboard(@NonNull final View view) {

InputMethodManager logs the following:

W/InputMethodManager: Ignoring showSoftInput() as view=com.google.android.material.textfield.TextInputEditText{5e38b94 VFED..CL. .F...... 0,0-770,153 aid=1073741824} is not served.

If you can add a delay to post its working.

Minimal sample app repro:

https://github.com/mialkan/fragment-keyboard

Android API version:
30-31

Material Library version:
1.6.0-1.6.1

Device:
Samsung Galaxy A71, Android 11 (30)
Pixel 4XL, Android 12 (31)
Samsung Galaxy M31, Android 12 (31)
Samsung Galaxy S20+, Android 12 (31)

@mialkan mialkan added the bug label Jun 10, 2022
@drchen drchen self-assigned this Jun 10, 2022
@chantellosejo
Copy link

As a corollary to this issue, switching from INPUT_MODE_TEXT to INPUT_MODE_CALENDAR via the toggle does not hide the keyboard if it has been opened. Could we also get a fix for this please? I think these issues may be related or the same issue showing up in different ways. Let me know if I need to create a new issue for this.

@paulfthomas paulfthomas assigned paulfthomas and unassigned drchen Oct 5, 2022
@paulfthomas
Copy link
Member

@chanakin can you create a separate bug with the steps to reproduce? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants