Skip to content

Commit 5d8f8f0

Browse files
authored
fix(Calendar): year prev/next buttons don't lose focus when they become disabled (#36343)
1 parent 131593c commit 5d8f8f0

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "fix(Calendar): year prev/next buttons don't lose focus when they become disabled",
4+
"packageName": "@fluentui/react-calendar-compat",
5+
"email": "sarah.higley@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}

packages/react-components/react-calendar-compat/library/src/components/CalendarYear/CalendarYear.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,12 @@ const CalendarYearNavArrow: React.FunctionComponent<CalendarYearNavArrowProps> =
245245
return (
246246
<button
247247
className={mergeClasses(classNames.navigationButton, disabled && classNames.disabled)}
248+
aria-disabled={disabled}
249+
tabIndex={disabled ? -1 : undefined}
248250
onClick={!disabled ? onNavigate : undefined}
249251
onKeyDown={!disabled ? onKeyDown : undefined}
250252
type="button"
251253
title={ariaLabelString}
252-
disabled={disabled}
253254
>
254255
{direction === CalendarYearNavDirection.Previous ? navigationIcons.upNavigation : navigationIcons.downNavigation}
255256
</button>

0 commit comments

Comments
 (0)