Skip to content

Commit

Permalink
prevent icon jumps
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianHoffmannS2 committed Dec 23, 2023
1 parent 9ff8a20 commit 990f871
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/ui-library/src/components/ui/icon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export class BlrIcon extends LitElement {
protected render() {
const sizeKey = this.ignoreSize ? 'full' : this.size.toLowerCase();

const unfullfilledRenderResult = html`<span class="blr-icon ${sizeKey}">
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>
</span>`;

if (IconMapping.hasOwnProperty(this.icon) && typeof IconMapping[this.icon] === 'function') {
const importedIcon = IconMapping[this.icon]();

Expand All @@ -33,9 +37,9 @@ export class BlrIcon extends LitElement {
// eslint-disable-next-line no-console
.catch((err) => console.error(err.message));

return until(fullfilledRenderResult, nothing);
return until(fullfilledRenderResult, unfullfilledRenderResult);
} else {
return nothing;
return unfullfilledRenderResult;
}
}
}
Expand Down

0 comments on commit 990f871

Please sign in to comment.