Skip to content

Commit 842b1bc

Browse files
authored
Fix SVG empty width and height (#5478)
1 parent b9e6f8f commit 842b1bc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • packages/ui/src/components/wui-icon

packages/ui/src/components/wui-icon/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { TemplateResult } from 'lit'
22
import { LitElement } from 'lit'
33
import { property } from 'lit/decorators.js'
4+
import { ifDefined } from 'lit/directives/if-defined.js'
45
import { html, unsafeStatic } from 'lit/static-html.js'
56

67
import { appStoreSvg } from '../../assets/svg/app-store.js'
@@ -298,7 +299,7 @@ export class WuiIcon extends LitElement {
298299

299300
// Return the Phosphor icon with dynamic tag
300301
// eslint-disable-next-line lit/binding-positions, lit/no-invalid-html
301-
return html`<${tag} size=${getPhosphorSize[this.size]} weight="${this.weight}"></${tag}>`
302+
return html`<${tag} size=${ifDefined(getPhosphorSize[this.size])} weight="${this.weight}"></${tag}>`
302303
}
303304

304305
// Fallback to regular SVG

0 commit comments

Comments
 (0)