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

[BUG] - Invalid DateTime appears in both inputs when cursor is moved to the beginning and user wants to enter specific values #100

Closed
Emilysta opened this issue Jan 22, 2024 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@Emilysta
Copy link

Describe the bug
Assume a timepicker with [enableKeyboardInput]="true" set.
In the hour input, when cursor is moved to the beginning and current value of input is 00, 01 or 02 [for 24h picker] when someone tries to enter e.g. 1, input value changes to Invalid DateTime.
In the minutes input, when cursor is moved to the beginning and current value of input is 00, 01, 02, 03, 04, 05 when someone tries to enter e.g. 1, input value changes to Invalid DateTime.

To Reproduce

Steps to reproduce the behavior:

  1. Click the input field to open the clicker
  2. Select hours input in 12h mode
  3. Enter e.g. 01
  4. Move the cursor to the beginning of the input
  5. Try to enter e.g. 1 by keyboard
  6. The hours input field contains Invalid DateTime

Expected behavior
Block user input, as in the rest of cases (e.g. 04 for hours in 12h mode)

Screenshots
Ad 2. image
Ad 3. image
Ad 4. image
Ad 6. image

Desktop:

  • OS: Windows
  • Browser: Chrome, Firefox

**Versions

  • ngx-mat-timepicker version 17.0.2 (but also appears on 17.0.3)
  • @angular/core version 17.0.5
  • @angular/material version 17.0.2
  • typescript version 5.2.2

Additional context
Seems like for 12h picker and hours input the problem is with entering values: 1 and 2.
Seems like for 24h picker and hours input the problem is with entering values: 1,2 and 3.
Seems like for minutes input the problem is with entering values: 1-9.

@Emilysta Emilysta changed the title [BUG] - Invalid DateTime appears in both inputs when cursor is moved to the begging and user wants to enter specific values [BUG] - Invalid DateTime appears in both inputs when cursor is moved to the beginning and user wants to enter specific values Jan 22, 2024
@tonysamperi
Copy link
Owner

Hi @Emilysta thanks for reporting.
This is basically related to #58.
I'm closing this as a dupe.

@tonysamperi tonysamperi added the duplicate This issue or pull request already exists label Jan 27, 2024
@tonysamperi
Copy link
Owner

@Emilysta by the way if you could tell me how you think the input at the bottom behaves in this blitz, it would help.

https://stackblitz.com/edit/ts-angular-13-web-container-starter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants