Skip to content

Commit

Permalink
Fix #7604: Calendar focus error with multiple months (#7607)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Jan 15, 2025
1 parent 5e349f2 commit d0a183d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/lib/calendar/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,7 @@ export const Calendar = React.memo(
navigation.current = { backward: true };
navBackward(event);
} else {
const prevMonthContainer = overlayRef.current.children[groupIndex - 1];
const prevMonthContainer = overlayRef.current.children[0].children[groupIndex - 1];
const cells = DomHandler.find(prevMonthContainer, 'table td span:not([data-p-disabled="true"])');
const focusCell = cells[cells.length - 1];

Expand All @@ -1417,7 +1417,7 @@ export const Calendar = React.memo(
navigation.current = { backward: false };
navForward(event);
} else {
const nextMonthContainer = overlayRef.current.children[groupIndex + 1];
const nextMonthContainer = overlayRef.current.children[0].children[groupIndex + 1];
const focusCell = DomHandler.findSingle(nextMonthContainer, 'table td span:not([data-p-disabled="true"])');

focusCell.tabIndex = '0';
Expand Down

0 comments on commit d0a183d

Please sign in to comment.