fix(date-picker): corrected inert value for true condition (#3054)

* fix(date-picker): corrected inert value for true condition #3044

* refactor(calendar): add todo comment

* feat(changeset): add changeset

---------

Co-authored-by: shrinidhi.upadhyaya <shrinidhi.upadhyaya@stud.uni-bamberg.de>
Co-authored-by: WK Wong <wingkwong.code@gmail.com>
This commit is contained in:
Shrinidhi Upadhyaya 2024-05-24 21:21:48 +02:00 committed by GitHub
parent 8048dcc0c3
commit bf68c91b9a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 2 deletions

View File

@ -0,0 +1,5 @@
---
"@nextui-org/calendar": patch
---
revise the inert attribute in `CalendarMonth` and `CalendarPicker`

View File

@ -40,8 +40,9 @@ export function CalendarMonth(props: CalendarMonthProps) {
className={slots?.gridBodyRow({class: classNames?.gridBodyRow})}
data-slot="grid-body-row"
// makes the browser ignore the element and its children when tabbing
// TODO: invert inert when switching to React 19 (ref: https://github.com/facebook/react/issues/17157)
// @ts-ignore
inert={isHeaderExpanded ? true : undefined}
inert={isHeaderExpanded ? "" : undefined}
>
{state
.getDatesInWeek(weekIndex, startDate)

View File

@ -66,8 +66,9 @@ export function CalendarPicker(props: CalendarPickerProps) {
})}
data-slot="picker-wrapper"
// makes the browser ignore the element and its children when tabbing
// TODO: invert inert when switching to React 19 (ref: https://github.com/facebook/react/issues/17157)
// @ts-ignore
inert={isHeaderExpanded ? true : undefined}
inert={isHeaderExpanded ? undefined : ""}
>
<div
ref={highlightRef}