Skip to content

Commit

Permalink
fix(month-view/year-view): create onMouseDown events (#15290)
Browse files Browse the repository at this point in the history
  • Loading branch information
didimmova authored Jan 27, 2025
1 parent 8d91cdb commit 867aac4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
[date]="date"
[showActive]="showActive"
(itemSelection)="selectDate($event)"
(mousedown)="onMouseDown()"
>
<span class="igx-calendar-view__item-inner" aria-hidden="true">
{{ formattedMonth(month).formatted | titlecase }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,15 @@ export class IgxMonthsViewComponent extends IgxCalendarViewDirective implements
super(dayInterval);
}

/**
* @hidden
*/
protected onMouseDown() {
if (this.tabIndex !== -1) {
this.el.nativeElement.focus();
}
}

/**
* Returns the locale representation of the month in the months view.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
[date]="date"
[showActive]="showActive"
(itemSelection)="selectDate($event)"
(mousedown)="onMouseDown()"
>
<span class="igx-calendar-view__item-inner" aria-hidden="true">
{{ formattedYear(year).formatted }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,13 @@ export class IgxYearsViewComponent extends IgxCalendarViewDirective implements C
year: this.yearFormat,
});
}

/**
* @hidden
*/
protected onMouseDown() {
if (this.tabIndex !== -1) {
this.el.nativeElement.focus();
}
}
}

0 comments on commit 867aac4

Please sign in to comment.