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

sap.m.FeedListItem: iconInitials never worked #3258

Closed
boghyon opened this issue May 19, 2021 · 3 comments
Closed

sap.m.FeedListItem: iconInitials never worked #3258

boghyon opened this issue May 19, 2021 · 3 comments

Comments

@boghyon
Copy link
Contributor

boghyon commented May 19, 2021

OpenUI5 version

Since the introduction of iconInitials (1.88): 454a41c#diff-8b72ed9ca72d9bf06081308bacffad14f5719bade70ed486635cd5ec2bfabdfa

URL (minimal example if possible)

https://jsbin.com/megaguq/edit?html,js,output

What is the expected result?

Same as initials on sap.m.Avatar: if there is no valid icon (src) set, use the iconInitials.

What happens instead?

Initials are never applied because:

  1. sap.m.FeedListItem always sets the person-placeholder icon as fallback:
    var sIconSrc = sIcon ? sIcon : IconPool.getIconURI("person-placeholder");
    var sId = this.getId() + '-icon';
    if (!this.oAvatar) {
    this.oAvatar = new Avatar({
    id: sId,
    src: sIconSrc,
  2. sap.m.Avatar, however, applies the initials only if there is no src set.
    Avatar.prototype._getActualDisplayType = function () {
    var sSrc = this.getSrc(),
    sInitials = this.getInitials();
    if (sSrc) {
    this._validateSrc(sSrc);
    } else if (sInitials && this._areInitialsValid(sInitials)) {
    this._sActualType = AvatarType.Initials;
    } else {
    Log.warning("No src and initials were provided", this);
    this._sActualType = AvatarType.Icon;
    this._bIsDefaultIcon = true;
    }
    return this._sActualType;
    };

Any other information? (attach screenshot if possible)

Avatar already uses the icon sap-icon://person-placeholder if its displayShape is Circle (== default shape of FeedListItem's iconDisplayShape). Hence, setting the person placeholder explicitly might be superfluous, unless Square icons are also supposed to display the person placeholder.

@tsanislavgatev
Copy link
Contributor

Hello @boghyon ,
Thank you for sharing this finding. I've created an internal incident 2180176684. The status of the issue will be updated here in GitHub.
Regards,
Tsanislav

@Madhu552
Copy link
Contributor

Madhu552 commented Jun 8, 2021

Changes is done for this issue with 8aba9a4.

@terezamch
Copy link
Contributor

Hello,

As the issue seem to be fixed by @Madhu552, I am closing the issue.

Best regards,
Tereza

boghyon referenced this issue Apr 19, 2024
BCP: 2180176684, 2180176686
Change-Id: I9c4a612f018ccc9f4ee7cdc52ad9fe3b6202ba06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants