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

[Date picker] Text input mode: Cursor should be positioned at end of text field

Open
#3,995 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

**Description:** In version 1.9.0, when opening DatePicker with text input mode and a default selection, the cursor was positioned at the end:
![Screenshot_1705689616](https://github.com/material-components/material-components-android/assets/1485456/63daa589-fb99-4fca-9d8e-e7bff4bb529a)

Since version 1.10.0 it is positioned at the beginning;
![Screenshot_1705689939](https://github.com/material-components/material-components-android/assets/1485456/b7600014-a3ae-4ba3-bfb1-4aab04225273)

**Expected behavior:** For usability, it is preferable to position cursor at the end, since in order to delete the default selection, user must now change cursor position first.

**Minimal sample app repro:** The issue can be reproduced with the Catalog app -> Date Picker. Set Default Selection to Today, and Input Mode to Text Input.

The problem seems to have been introduced with commit 4032a741127b4715c3bbcd4cab08494b39ae5bdb

**Android API version:** API 32

**Material Library version:** Since 1.10.0

**Device:** Emulator

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

Reproduce the issue in the Catalog app's Date Picker with Default Selection set to Today and Input Mode set to Text Input. Inspect commit 4032a741127b4715c3bbcd4cab08494b39ae5bdb and the related date-picker code. Done means the cursor is positioned at the end of the preselected text, matching the behavior in version 1.9.0.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.