telerik / kendo-angular

Issue tracker - Kendo UI for Angular
http://www.telerik.com/kendo-angular-ui/
Other
466 stars 215 forks source link

[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 1 month ago

zstoyanova9 commented 1 month ago

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 - https://github.com/telerik/kendo-angular/issues/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 commented 1 month ago

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