Skip to content

Datetimepicker - closed-event fired twice when using keyboard enter #392

@MarkCuypersPpw

Description

@MarkCuypersPpw

When using the timepicker with following options:

      <mtx-datetimepicker
        #timePicker
        [type]="'time'"
        [mode]="'portrait'"
        [startView]="'clock'"
        [twelvehour]="false"
        [timeInterval]="1"
        [touchUi]="false"
        [timeInput]="true"
        [disabled]="isDisabled"
        [startAt]="control?.value"
        (closed)="onDatePickerClosed()"></mtx-datetimepicker>

I noticed that the console log in my onDatePickerClosed function is logged twice. This only happens when I use the keyboard enter key. It doesn't matter if I press enter on the "cancel" button or the "OK" button.
{3381AB8F-04BB-4455-986C-21328C5CA5E6}

After executing this scenario, the picker dialog stays open and I can't close it anymore. I'm locked in it and have to refresh the browser.

When I execute the same scenario but instead I use the spacebar to press the Cancel of OK button, it works as expected. Also when I click the buttons with the mouse there's no issue.

This behavior is new since I upgraded to Angular 19 (with Material 19 and Matero 19)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: datetimepickerIssues about datetimepickerquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions