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

[DateInputs] Focusing the year segment with mouse click and changing its value after having modified other segments results in inconsistent behavior #4358

Open
zstoyanova9 opened this issue Jul 17, 2024 · 1 comment

Comments

@zstoyanova9
Copy link

Describe the bug
When focusing the year segment manually using mouse click, after having previously modified the other segments, and then attempting to change the value of the year segment, produces inconsistent behavior for the year value.

There are times when the user is able to enter only two numbers and the focus moves to the next segment, at other times - only one number can be entered and the focus jumps.

chrome_1mGCMXVOXV

When there is not a next segment available, the whole year can be entered, however, the segment is not initially reset and the previous numbers are kept. Also, when entering each number, the previous numbers move their position respectively to the left.

chrome_zI8sLI0HUe

To Reproduce

  1. Open the following StackBlitz example - https://stackblitz.com/edit/angular-aw1rst
  2. Modify the value of the first two segments using the keyboard numbers.
  3. Focus the year segment using mouse click.
  4. Start modifying the value of the year segment.

Expected behavior
The behavior should be consistent in this scenario, i.e. the year segment should be initially reset when entering the first number and the user should be able to enter the whole year afresh.

Additional context
This behavior is possibly related to and might be fixed with - #3824

It seems that the unexpected behavior is only reproducible when using a date format that contains "MMM" or "MMMM" specifiers, which is the problematic format stated in the above issue that does not automatically move the focus to the year part.

@zstoyanova9
Copy link
Author

It seems that the inconsistent behavior can also be reproduced in cases when a date format, in which the year segment is placed at the beginning, is used for the component.
StackBlitz example - https://stackblitz.com/edit/angular-aw1rst-kb8zvl

chrome_TawKD1YuHA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant