Skip to content

[BUG] - Keyboard input in v15.1.4 is difficult to use #58

@cjohnston-ey

Description

@cjohnston-ey

Describe the bug
I believe changes made to fix #49 made it more difficult to enter time with the keyboard.

To Reproduce
Stackblitz: https://stackblitz.com/github/cjohnston-nuvalence/ngx-mat-timepicker-keyboard

If I want to enter a time with "35" as the minutes by the keyboard, for example, there are a couple of ways to do it and each has issues.

All scenarios assume a timepicker with [enableKeyboardInput]="true" set.

Scenario 1:

  1. Click the input field to open the clicker
  2. The hours field is selected by default
  3. Tab to move the keyboard entry to the minutes field or click at the end of the minutes input field
  4. The cursor is at the end of the input field
  5. Type "35"
  6. The minutes input field contains "0035" and the control's time setting is not changed

Scenario 2:

  1. Click the input field to open the clicker
  2. The hours field is selected by default
  3. Click at the beginning of the minutes input field
  4. The cursor is at the beginning of the input field
  5. Type "35"
  6. The minutes input field changes to "30" after entering the 3 and the 5 is ignored

Scenario 3:

  1. Click the input field to open the clicker
  2. The hours field is selected by default
  3. Click at the middle of the minutes input field
  4. The cursor is between the 0s in the input field
  5. Type "35"
  6. The minutes input field changes to "03" after entering the 3 and the 5 is ignored

Expected behavior
In all scenarios the minutes should be set as 35

Desktop (if execution):

  • OS: MacOS
  • Browser: chrome, safari

** Versions

  • ngx-mat-timepicker version [15.1.4]
  • @angular/core version [15.1.0]
  • @angular/material version [15.1.0]
  • typescript version [4.9.4]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions