uswds icon indicating copy to clipboard operation
uswds copied to clipboard

USWDS - Enhancement: Choosing a date in the calendar on mobile opens keyboard unnecessarily

Open ajanickiv opened this issue 1 year ago • 3 comments

Describe the bug

Choosing a date in the calendar popup focuses the input and opens keyboard on mobile. This blocks any content below from being displayed and the user is forced to close the keyboard before continuing.

Steps to reproduce the bug

  1. Go to the date picker component on the USWDS site on a mobile device
  2. Click the calendar button to open the calendar pop up
  3. Choose a valid date
  4. Calendar pop up will close, date will set in input, and focus changes to the input
  5. Mobile keyboard will open mobile_datepicker_screenshot

Expected Behavior

Date is set in the input but the focus stays on the calendar popup button. This should prevent the mobile keyboard from opening.

Related code

In packages/usa-date-picker/src/index.js the focus is explicitly set to the input. A better user experience would be to place the focus on the calendar button. image

Screenshots

No response

System setup

USWDS 3.7.0 Edge 119

Additional context

No response

Code of Conduct

ajanickiv avatar Nov 28 '23 17:11 ajanickiv