Make sure the image become hidden again if the src becomes falsy
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tp/tp-avatar",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"description": "",
|
||||
"main": "tp-avatar.js",
|
||||
"scripts": {
|
||||
|
@@ -62,7 +62,7 @@ class TpAvatar extends DomQuery(LitElement) {
|
||||
const { loaded, hasSrc } = this;
|
||||
|
||||
return html`
|
||||
<div id="avatarImg" part="avatarImg" class=${classMap({ visible: loaded, hidden: !loaded })}></div>
|
||||
<div id="avatarImg" part="avatarImg" class=${classMap({ visible: loaded && hasSrc, hidden: !loaded || !hasSrc })}></div>
|
||||
<tp-icon id="placeHolder" part="placeholder" .icon=${TpAvatar.defaultAccountIcon} class=${classMap({ visible: !loaded || !hasSrc, hidden: loaded && hasSrc})}></tp-icon>
|
||||
`;
|
||||
}
|
||||
|
Reference in New Issue
Block a user