Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(calendar): apply inert attribute according to isHeaderExpanded #3087

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/two-snakes-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/calendar": patch
---

fix inert attribute value error
2 changes: 1 addition & 1 deletion packages/components/calendar/src/calendar-month.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function CalendarMonth(props: CalendarMonthProps) {
// 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 ? "" : undefined}
{...{inert: isHeaderExpanded ? "" : undefined}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using null instead of an empty string for the inert attribute to ensure compatibility across all browsers.

- {...{inert: isHeaderExpanded ? "" : undefined}}
+ {...{inert: isHeaderExpanded ? null : undefined}}

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
{...{inert: isHeaderExpanded ? "" : undefined}}
{...{inert: isHeaderExpanded ? null : undefined}}

>
{state
.getDatesInWeek(weekIndex, startDate)
Expand Down
2 changes: 1 addition & 1 deletion packages/components/calendar/src/calendar-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function CalendarPicker(props: CalendarPickerProps) {
// 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 ? undefined : ""}
{...{inert: isHeaderExpanded ? "" : undefined}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using null instead of an empty string for the inert attribute to ensure compatibility across all browsers.

- {...{inert: isHeaderExpanded ? "" : undefined}}
+ {...{inert: isHeaderExpanded ? null : undefined}}

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
{...{inert: isHeaderExpanded ? "" : undefined}}
{...{inert: isHeaderExpanded ? null : undefined}}

>
<div
ref={highlightRef}
Expand Down