Skip to content

Commit 41c9fa1

Browse files
authored
Merge pull request #6032 from IgniteUI/calendar-IE-kb-master
Fix calendar kb navigation IE #5895
2 parents 02c6dcf + 7c6e48d commit 41c9fa1

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

projects/igniteui-angular/src/lib/calendar/days-view/daysview-navigation.service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Injectable } from '@angular/core';
2-
import { isIE } from '../../core/utils';
32
import { IgxDayItemComponent } from './day-item.component';
43
import { IgxDaysViewComponent } from './days-view.component';
54
import { ScrollMonth } from '../calendar-base';
@@ -11,6 +10,8 @@ enum Direction {
1110
Right = 'ArrowRight',
1211
}
1312

13+
const ARROW = 'Arrow';
14+
1415
/** @hidden */
1516
@Injectable()
1617
export class IgxDaysViewNavigationService {
@@ -20,9 +21,8 @@ export class IgxDaysViewNavigationService {
2021
* @hidden
2122
*/
2223
public focusNextDate(target: HTMLElement, key: string, nextView = false) {
23-
if (isIE()) {
24-
target = target.parentElement;
25-
}
24+
if (target.childElementCount === 0) { target = target.parentElement; }
25+
if (key.indexOf('Arrow') === -1) { key = ARROW.concat(key); }
2626
const monthView = this.monthView;
2727
const node = monthView.dates.find((date) => date.nativeElement === target);
2828
let dates = monthView.dates.toArray(),

projects/igniteui-angular/src/lib/calendar/months-view/months-view.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ export class IgxMonthsViewComponent implements ControlValueAccessor {
273273

274274
for (let index = months.indexOf(node) - 1; index >= 0; index--) {
275275
const nextNodeRect = months[index].nativeElement.getBoundingClientRect();
276-
if (nodeRect.top !== nextNodeRect.top && nodeRect.left === nextNodeRect.left) {
276+
const tolerance = 6;
277+
if (nodeRect.top !== nextNodeRect.top && (nextNodeRect.left - nodeRect.left) < tolerance) {
277278
months[index].nativeElement.focus();
278279
break;
279280
}
@@ -298,7 +299,8 @@ export class IgxMonthsViewComponent implements ControlValueAccessor {
298299

299300
for (let index = months.indexOf(node) + 1; index < months.length; index++) {
300301
const nextNodeRect = months[index].nativeElement.getBoundingClientRect();
301-
if (nodeRect.top !== nextNodeRect.top && nodeRect.left === nextNodeRect.left) {
302+
const tolerance = 6;
303+
if (nextNodeRect.top !== nodeRect.top && (nodeRect.left - nextNodeRect.left) < tolerance ) {
302304
months[index].nativeElement.focus();
303305
break;
304306
}

projects/igniteui-angular/src/lib/core/styles/components/calendar/_calendar-component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
}
3838

3939
@include e(body-column) {
40-
@extend %cal-column-display !optional;
40+
@extend %cal-column-year !optional;
4141
}
4242

4343
@include e(label) {

projects/igniteui-angular/src/lib/core/styles/components/calendar/_calendar-theme.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,12 @@
453453
align-items: center;
454454
}
455455

456+
%cal-column-year {
457+
%cal-value--year {
458+
flex: 1 0 0;
459+
}
460+
}
461+
456462
%cal-value {
457463
position: relative;
458464
display: flex;

0 commit comments

Comments
 (0)