Skip to content

Commit

Permalink
fix(List): getting wrong zIndex on initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
rivka-ungar authored Dec 12, 2024
1 parent 3c3fe12 commit 17b01e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/components/List/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ const List: VibeComponent<ListProps> & {
return child;
}
const id = (child.props as { id: string }).id || `${overrideId}-item-${index}`;
const isFocusableItem = isListItem(childrenRefs.current[index]);

const currentRef = childrenRefs.current[index];
const isFocusableItem = currentRef === undefined || currentRef === null || isListItem(currentRef);
return React.cloneElement(child, {
// @ts-ignore not sure how to deal with ref here
ref: ref => (childrenRefs.current[index] = ref),
Expand Down

0 comments on commit 17b01e3

Please sign in to comment.