Skip to content

Commit

Permalink
fix(core) Add IE11 event.key support (#2342)
Browse files Browse the repository at this point in the history
  • Loading branch information
salarenko committed Apr 14, 2020
1 parent fefdc5d commit f89e643
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libs/core/src/lib/calendar/calendar.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,16 @@ export class CalendarService {
*/
onKeydownHandler(event: KeyboardEvent, index: number): void {
const rtl: boolean = this._rtlService && this._rtlService.rtl.getValue();

switch (event.key) {
case 'Spacebar':
case 'Enter':
case ' ': {
event.preventDefault();
this.onKeySelect.next(index);
break;
}
case 'Left':
case 'ArrowLeft': {
event.preventDefault();
if (!rtl) {
Expand All @@ -123,6 +125,7 @@ export class CalendarService {
}
break;
}
case 'Right':
case 'ArrowRight': {
event.preventDefault();
if (!rtl) {
Expand All @@ -132,6 +135,7 @@ export class CalendarService {
}
break;
}
case 'Up':
case 'ArrowUp': {
event.preventDefault();
if (index <= this.colAmount - 1) {
Expand All @@ -141,6 +145,7 @@ export class CalendarService {
}
break;
}
case 'Down':
case 'ArrowDown': {
event.preventDefault();
if (index >= this.getId(this.rowAmount - 1, 0)) {
Expand Down

0 comments on commit f89e643

Please sign in to comment.