Skip to content
Open
Changes from 1 commit
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
6 changes: 4 additions & 2 deletions template/layouts/default/shell/control-panel/nav-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ const NavItem = ({
icon={icon}
key={`router-leaf-${target ?? title}`}
disabled={disabled}
aria-disabled={disabled ? 'true' : undefined}
>
<a
href={trimExtension(target)}
aria-current={isActive ? 'page' : undefined}
data-icon-trailing={iconTrailing}
tabindex={disabled ? '-1' : undefined}
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

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

Suggested change
tabindex={disabled ? '-1' : undefined}
tabIndex={disabled ? '-1' : undefined}

In React/JSX, the attribute should be tabIndex (camelCase) instead of tabindex (lowercase). React will issue a warning about this in the console, and the lowercase version may not work correctly in all scenarios.

Copilot uses AI. Check for mistakes.
aria-disabled={disabled ? 'true' : undefined}
>
Comment on lines 30 to 36
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

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

When a link is disabled, it should not be navigable via click. Consider adding an onClick handler that prevents navigation when disabled, or use CSS pointer-events to prevent interaction. Without this, users can still navigate to the disabled link by clicking on it, defeating the purpose of disabling it.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot is right. Just adding aria-disabled and tabIndex doesn't prevent clicks from triggering navigation. One fix is to conditionally remove the href when disabled (e.g., href={disabled ? undefined : path}).

{title}
</a>
Expand Down Expand Up @@ -61,12 +62,13 @@ const NavItem = ({
icon={icon}
key={`router-leaf-${path ?? title}`}
disabled={disabled}
aria-disabled={disabled ? 'true' : undefined}
>
<a
href={trimExtension(path)}
aria-current={getAriaCurrent(trimExtension(path))}
data-icon-trailing={iconTrailing}
tabindex={disabled ? '-1' : undefined}
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

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

Suggested change
tabindex={disabled ? '-1' : undefined}
tabIndex={disabled ? '-1' : undefined}

In React/JSX, the attribute should be tabIndex (camelCase) instead of tabindex (lowercase). React will issue a warning about this in the console, and the lowercase version may not work correctly in all scenarios.

Copilot uses AI. Check for mistakes.
aria-disabled={disabled ? 'true' : undefined}
>
Comment on lines 66 to 72
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

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

When a link is disabled, it should not be navigable via click. Consider adding an onClick handler that prevents navigation when disabled, or use CSS pointer-events to prevent interaction. Without this, users can still navigate to the disabled link by clicking on it, defeating the purpose of disabling it.

Copilot uses AI. Check for mistakes.
{title}
</a>
Expand Down
Loading