Skip to content

Commit 8b5602b

Browse files
fix(Avatar): add missing ref on default avatar (#2516)
* fix(Avatar): add missing ref on default avatar * Create nasty-frogs-end.md
1 parent 0ca28d0 commit 8b5602b

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.changeset/nasty-frogs-end.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@razorpay/blade": patch
3+
---
4+
5+
fix(Avatar): misaligned menu on Avatar with icon

packages/blade/src/components/Avatar/Avatar.web.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ const _Avatar: React.ForwardRefRenderFunction<BladeElementRef, AvatarProps> = (
127127
);
128128
}
129129

130-
return <AvatarButton {...commonButtonProps} icon={icon ?? UserIcon} />;
130+
return <AvatarButton ref={ref as never} {...commonButtonProps} icon={icon ?? UserIcon} />;
131131
};
132132

133133
const isSquare = variant === 'square';

packages/blade/src/components/Menu/docs/Menu.stories.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,11 @@ Default.args = {
323323
trigger: <Avatar name="Saurabh Daware" size="large" color="primary" />,
324324
};
325325

326+
export const WithAvatarIcon = MenuTemplate.bind({});
327+
WithAvatarIcon.args = {
328+
trigger: <Avatar size="large" color="primary" />,
329+
};
330+
326331
export const CustomItems = CustomOverlayMenuTemplate.bind({});
327332
CustomItems.args = {
328333
openInteraction: 'hover',

0 commit comments

Comments
 (0)