Skip to content

Commit

Permalink
feat(calendar): fix bug in focusing prev day #4282
Browse files Browse the repository at this point in the history
  • Loading branch information
hanastasov committed Aug 21, 2019
1 parent bbbccba commit 907efab
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export class IgxDaysViewComponent extends IgxCalendarBase implements DoCheck {

// focus item in current month
for (let i = index; i - 7 > -1; i -= 7) {
day = prevView ? node : dates[index - 7];
day = prevView ? node : dates[i - 7];
if (!day.isDisabled && !day.isHidden && !day.isOutOfRange && day.isCurrentMonth) {
day.nativeElement.focus();
break;
Expand Down Expand Up @@ -351,7 +351,7 @@ export class IgxDaysViewComponent extends IgxCalendarBase implements DoCheck {
if (!node) { return; }

for (let i = index; i > 0; i--) {
day = prevView ? node : dates[index - 1];
day = prevView ? node : dates[i - 1];
if (!day.isDisabled && !day.isHidden && !day.isOutOfRange && day.isCurrentMonth) {
day.nativeElement.focus();
break;
Expand Down

0 comments on commit 907efab

Please sign in to comment.