sap.m.FeedListItem: `icon` related settings not updatable after initial rendering
OpenUI5 version:
Since https://github.com/SAP/openui5/commit/454a41c8b7034c673a9c34b92921ced54b7bdce5#diff-8b72ed9ca72d9bf06081308bacffad14f5719bade70ed486635cd5ec2bfabdfa
Steps to reproduce the problem
- Open https://jsbin.com/megaguq/edit?html,js,output
- Using the Control Tree diagnostic tool, play around with icon related settings such as setting
icontosap-icon://sap-ui5.
We can see that those changes are not applied even though the FeedListItem itself does get invalidated and rerenders.
Because of this issue, also activeIcon fails to work since 1.88.
The main issue is at _getAvatar:
https://github.com/SAP/openui5/blob/98bb2bda851303610df5809ae251adb7712049cc/src/sap.m/src/sap/m/FeedListItem.js#L441-L456
Unlike FeedInput, subsequent changes on Avatar are never applied.
A quick fix could look something like this:
FeedListItem.prototype._getAvatar = function() {
var sIcon = this.getIcon();
var sIconSrc = sIcon ? sIcon : "..."; // another issue: https://github.com/SAP/openui5/issues/3258
var sId = this.getId() + "-icon";
this.oAvatar = this.oAvatar || new Avatar(sId);
this.oAvatar.applySettings({
src: sIconSrc,
displayShape: this.getIconDisplayShape(),
initials: this.getIconInitials(),
displaySize: this.getIconSize(),
ariaLabelledBy: this.getSender()
});
// ...
But while we're at it: Avatar is currently defined with var Avatar = library.Avatar. Wouldn't it be better to properly require it in the dependency list early and then using "sap.m.Avatar" as the type of a hidden aggregation? Similar to _avatar in ListContentItem or _placeholder in ObjectPageHeaderContent. FeedListItems as well as FeedInputs are typically used with profile pictures as shown in the design guideline. Or what are the reasons for declaring the dependency like this var Avatar = library.Avatar?
Hello @boghyon , Thank you for sharing this finding. I've created an internal incident 2180176686. The status of the issue will be updated here in GitHub. Regards, Tsanislav
Changes is done for this issue with 8aba9a495979a9a97ba2ae68273939b7488d1082.
Hello,
As the issue seem to be fixed, I am closing the issue.
Best regards, Tereza