Skip to content

Commit

Permalink
fix: only set avatar img src attribute if property is defined (#8329)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan authored Dec 12, 2024
1 parent 4c0d03b commit e751f87
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/avatar/src/vaadin-lit-avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
import './vaadin-avatar-icons.js';
import { html, LitElement } from 'lit';
import { ifDefined } from 'lit/directives/if-defined.js';
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
Expand Down Expand Up @@ -44,7 +45,7 @@ class Avatar extends AvatarMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElem
return html`
<img
?hidden="${!this.__imgVisible}"
src="${this.img}"
src="${ifDefined(this.img)}"
aria-hidden="true"
@error="${this.__onImageLoadError}"
draggable="false"
Expand Down

0 comments on commit e751f87

Please sign in to comment.