material-components / material-components/material-components-android

[MaterialTimePicker] Keyboard re-appears after closing dialog

Open
#1,956 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Widget: TimePicker
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

**Description:**
Using the MaterialTimePicker dialog with _INPUT_MODE_KEYBOARD_ and pressing either positive or negative button will cause the keyboard to re-appear (but alphanumeric, not with digits).

This does not occur when dismissing the dialog by clicking outside of it, only when pressing Cancel or OK while the digits keyboard is open.

https://user-images.githubusercontent.com/11249107/103244036-5fef2f00-4964-11eb-8450-419db5ee3ed1.mp4

Maybe the following is related:
```
2020-12-28 23:17:48.041 1291-1291/com.google.android.inputmethod.latin E/KeyboardViewController: KeyboardViewController.show():438 Requesting to show sub view with id 2131428318(key_pos_password_header_numbers) which doesn't exist in current keyboard view
jyl
at klb.a(PG:195)
at bty.a(PG:4)
at com.google.android.apps.inputmethod.latin.keyboard.LatinPasswordKeyboard.a(PG:19)
at kfh.a(PG:15)
at kev.a(PG:31)
at kev.H(PG:26)
at kez.d(PG:10)
at kez.b(PG:108)
at com.android.inputmethod.latin.LatinIME.b(PG:339)
at dwq.onStartInputView(PG:786)
at android.inputmethodservice.InputMethodService.doStartInput(InputMethodService.java:2339)
at android.inputmethodservice.InputMethodService$InputMethodImpl.startInput(InputMethodService.java:620)
at android.inputmethodservice.InputMethodService$InputMethodImpl.dispatchStartInputWithToken(InputMethodService.java:649)
at android.inputmethodservice.IInputMethodWrapper.executeMessage(IInputMethodWrapper.java:199)
at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:44)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
```

**Expected behavior:** The keyboard does not re-open after closing the dialog.

**Source code:**
```
val dialog = MaterialTimePicker.Builder()
.setHour(time.hour)
.setMinute(time.minute)
.setTimeFormat(if (is24HourFormat) TimeFormat.CLOCK_24H else TimeFormat.CLOCK_12H)
.setInputMode(INPUT_MODE_KEYBOARD)
.build()
dialog.show(parentFragmentManager, "MaterialTimePicker")
```

**Android API version:** 26 and 30

**Material Library version:** 1.3.0-alpha03

**Device:** Emulator Nexus 4 API 30 and Samsung SM-A320FL API level 26

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with MaterialTimePicker in INPUT_MODE_KEYBOARD on the reported Android API levels, testing both positive and negative buttons versus outside dismissal. Trace the dialog's keyboard and focus handling; done means closing with OK or Cancel does not reopen an alphanumeric keyboard.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.