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 with image and shape="circle" doesn't have border-radius style #14144

Closed
vokic opened this issue Nov 16, 2023 · 6 comments
Closed

Avatar with image and shape="circle" doesn't have border-radius style #14144

vokic opened this issue Nov 16, 2023 · 6 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@vokic
Copy link

vokic commented Nov 16, 2023

Describe the bug

In p-avatar component the picture is displayed, but the shape="circle" property doesn't work (it generates a square image, which is the default option according to the documentation).

The images in the documentation are rounded by themselves (transparent corners) so it seems they are rounded by shape="circle":

Image showing transparent pixels

Easy fix is using inline [style]="{ overflow: 'hidden', 'border-radius': '50%' }" to achieve the wanted outcome.

Can anyone look into that. The same issue was present in PrimeReact (primefaces/primereact#1773), and fixed by what seems as an easy fix. Can it be done in PrimeNG?

Thanks!

Environment

Primeng: 16.7.1,
Angular: 16.2.8,
Windows 10,
Chrome: 119.0.6045.159,
VSCode: 1.84.2

Reproducer

No response

Angular version

16.2.8

PrimeNG version

16.7.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.16.1

Browser(s)

Chrome: 119.0.6045.159

Steps to reproduce the behavior

<p-avatar
[image]="imageurl.jpg"
size="normal"
shape="circle"
>

Expected behavior

Expected rounded corners, but no style is applied with shape property.

@vokic vokic added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 16, 2023
@cetincakiroglu
Copy link
Contributor

Hi,

Could you please share a stackblitz reproducer?

@SoyDiego
Copy link
Contributor

I think is working ok. I tried with this image (square) and I can see perfectly rounded:

image

Here the test code:

<div class="card flex justify-content-center gap-2">
   <p-avatar image="https://www.purina.es/sites/default/files/styles/ttt_image_690/public/2021-01/Basset%20Bleu%20De%20Gascogne1.webp?itok=Xj0bIelA" shape="circle"></p-avatar>
   <p-avatar label="T"></p-avatar>
</div>

image

@vokic
Copy link
Author

vokic commented Nov 17, 2023

You are correct, it's on my part. The property is strikethrough. Something somewhere is overriding it...

@SoyDiego
Copy link
Contributor

You are correct, it's on my part. The property is strikethrough. Something somewhere is overriding it...

You can close the issue if it's solved it. :)

@der-tobi
Copy link

I'm encountering the same problem.

You are correct, it's on my part. The property is strikethrough. Something somewhere is overriding it...

The something in my case is the material light compact template which does not have Layered CSS.
See https://developer.mozilla.org/en-US/docs/Web/CSS/@layer

@mertsincan
Copy link
Member

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you reopen the issue so we can include it in our roadmap?
Please don't forget to add your feedback as a comment after reopening the issue. These will be taken into account by us and will contribute to the development of this feature. Thanks a lot for your understanding!

Best Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

5 participants