Skip to content
Open
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
10 changes: 9 additions & 1 deletion packages/raystack/components/breadcrumb/breadcrumb-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,15 @@ export const BreadcrumbItem = forwardRef<
if (dropdownItems) {
return (
<Menu>
<Menu.Trigger className={styles['breadcrumb-dropdown-trigger']}>
<Menu.Trigger
ref={ref as React.Ref<HTMLButtonElement>}
className={cx(styles['breadcrumb-dropdown-trigger'], className)}
id={props.id}
title={props.title}
aria-label={props['aria-label']}
aria-labelledby={props['aria-labelledby']}
aria-describedby={props['aria-describedby']}
>
Comment on lines +58 to +66
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Inconsistent prop forwarding between dropdown and non-dropdown paths.

The non-dropdown path spreads all props via ...props (line 94), but the dropdown path only forwards a subset (id, title, and three ARIA attributes). This means data-* attributes, other ARIA attributes, and event handlers passed by callers will be silently ignored when dropdownItems is provided.

Consider spreading the remaining props to Menu.Trigger for consistency, or document the limited prop support for the dropdown variant.

Suggested fix to forward remaining props
          <Menu.Trigger
            ref={ref as React.Ref<HTMLButtonElement>}
            className={cx(styles['breadcrumb-dropdown-trigger'], className)}
-            id={props.id}
-            title={props.title}
-            aria-label={props['aria-label']}
-            aria-labelledby={props['aria-labelledby']}
-            aria-describedby={props['aria-describedby']}
+            {...props}
          >
📝 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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Menu.Trigger
ref={ref as React.Ref<HTMLButtonElement>}
className={cx(styles['breadcrumb-dropdown-trigger'], className)}
id={props.id}
title={props.title}
aria-label={props['aria-label']}
aria-labelledby={props['aria-labelledby']}
aria-describedby={props['aria-describedby']}
>
<Menu.Trigger
ref={ref as React.Ref<HTMLButtonElement>}
className={cx(styles['breadcrumb-dropdown-trigger'], className)}
{...props}
>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/raystack/components/breadcrumb/breadcrumb-item.tsx` around lines 58
- 66, The dropdown branch only forwards specific props to Menu.Trigger (id,
title, aria-*) causing data-*, other ARIA attributes, and event handlers to be
dropped when dropdownItems is present; update the Menu.Trigger call in
breadcrumb-item.tsx (the dropdown path where Menu.Trigger is rendered) to spread
the remaining props (e.g., include ...props or a filteredProps object) so that
Menu.Trigger receives the same external attributes and event handlers as the
non-dropdown path (which uses ...props), ensuring consistent prop forwarding for
dropdownItems and non-dropdown variants.

{label}
<ChevronDownIcon className={styles['breadcrumb-dropdown-icon']} />
</Menu.Trigger>
Expand Down
Loading