SAP / ui5-webcomponents

UI5 Web Components - the enterprise-flavored sugar on top of native APIs! Build SAP Fiori user interfaces with the technology of your choice.
https://sap.github.io/ui5-webcomponents/
Apache License 2.0
1.54k stars 265 forks source link

[ui5-avatar]: initials are not shown when icon attribute is provided #6655

Closed pankajpandey01 closed 1 year ago

pankajpandey01 commented 1 year ago

Bug Description

Scenario: image slot: not provided initials: provided icon: provided

In above scenario, avatar is not showing initials, instead showing icons.

Affected Component

ui5-avatar

Expected Behaviour

Scenario: image slot: not provided initials: provided icon: provided

In above scenario, avatar should shown initials. Avatar render order should be image > initials > icon

Isolated Example

https://codesandbox.io/s/ui5-webcomponents-forked-r3dgkg

Steps to Reproduce

Please refer example.

Log Output, Stack Trace or Screenshots

No response

Priority

None

UI5 Web Components Version

1.10.3

Browser

Chrome, Edge, Firefox, Safari

Operating System

No response

Additional Context

Stakeholder Info

Declaration

plamenivanov91 commented 1 year ago

Hello @SAP/ui5-webcomponents-topic-p,

The reporter claims that the priority order of the avatar properties should be image > initials > icon but at this point it seems like the icon has higher priority over the initials.

Is this expected behavior?

Regards, Plamen Ivanov

yanaminkova commented 1 year ago

Hello @pankajpandey01,

The icon is with higher rendering priority than the initials . I would advise you to use only one of the attributes and not two at the same time. In your case, since you want to show initials, there is no need of the icon attribute. If the provided initials are not valid, the renderer will add fallback icon by itself.

Thanks and regards, Yana

pankajpandey01 commented 1 year ago

Hi @yanaminkova We want to show "person-placeholder" as fallback icon. Currently "employee" is shown as fallback from avatar component . Please suggest, how we can change default fallback icon?

yanaminkova commented 1 year ago

Hi @pankajpandey01, For the moment, this is not possible, but I created a backlog item, so we will add this functionality. Internal Reference: BGSOFUIPIRIN-6092

yanaminkova commented 1 year ago

Hi @pankajpandey01,

the functionality for setting custom fallback icon is already available.

Regards, Yana