Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<Avatar> does not respect size property when used with placeholderInitials property #659

Closed
rpocklin opened this issue Mar 7, 2023 · 0 comments · Fixed by #660
Closed

Comments

@rpocklin
Copy link
Contributor

rpocklin commented Mar 7, 2023

Describe the bug
When using the placeholderInitials property, the Avatar component does not respect any specified valid size properties.

This is due to:

  • The size being hard coded as w-10 h-10 in the avatar.root.initials.base theme defaults here
  • The size class property not being included when being rendered here

To Reproduce
Steps to reproduce the behavior:

  1. Define an Avatar component as follows:
  2. <Avatar placeholderInitials="RR" size="xl" />
  3. Inspect the styling when rendered and note that the xl size has not been applied, and sizing is fixed at w-10 h-10.

Expected behaviour
Expect that size="xl" (or any other valid specified size) takes effect when used.

Screenshots
Before
Screen Shot 2023-03-07 at 11 17 17 am

After
Screen Shot 2023-03-07 at 11 16 46 am

System information:
N/A

Project information:

  • Tailwind: 3.2.7
  • Flowbite: 1.6.3
  • Flowbite React: 0.4.1
  • Type: CRA

Additional context

  • Added a unit test that was failing before code changes were applied to Avatar.tsx
  • Added example in AvatarPage.tsx to visually see the size differences successfully rendered when using placeholderInitials.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant