Skip to content

Commit 8b0d0b4

Browse files
committed
fix(breadcrumb): restore useRef to enable proper Stencil attributePassing
After testing multiple approaches (type changes, conditional configs, disabling attributePassing), discovered that removing useRef may have CAUSED the nested navigation ARIA issue rather than fixing it. Navigation component with useRef works correctly in tests. This commit restores useRef and ref={_ref} to breadcrumb to match the working pattern and enable proper Stencil attribute delegation from custom element to root nav element.
1 parent 9195667 commit 8b0d0b4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/components/src/components/breadcrumb/breadcrumb.lite.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { useDefaultProps, useMetadata, useStore } from '@builder.io/mitosis';
1+
import {
2+
useDefaultProps,
3+
useMetadata,
4+
useRef,
5+
useStore
6+
} from '@builder.io/mitosis';
27
import { cls } from '../../utils';
38
import { DBIcon } from '../icon';
49
import type { DBBreadcrumbProps, DBBreadcrumbState } from './model';
@@ -14,6 +19,7 @@ useDefaultProps<DBBreadcrumbProps>({
1419
});
1520

1621
export default function DBBreadcrumb(props: DBBreadcrumbProps) {
22+
const _ref = useRef<HTMLElement | any>(null);
1723
const state = useStore<DBBreadcrumbState>({
1824
isExpanded: false,
1925
toggleExpanded() {
@@ -23,6 +29,7 @@ export default function DBBreadcrumb(props: DBBreadcrumbProps) {
2329

2430
return (
2531
<nav
32+
ref={_ref}
2633
id={props.id}
2734
class={cls('db-breadcrumb', props.className)}
2835
data-size={props.size}

0 commit comments

Comments
 (0)