From 13b2f8018d33ccede88c7501ddd75003dfbf1137 Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Wed, 16 Mar 2022 09:04:35 -0400 Subject: [PATCH] remove sl-error payload --- docs/resources/changelog.md | 1 + src/components/icon/icon.ts | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/resources/changelog.md b/docs/resources/changelog.md index ee4558bf..5d5c1d05 100644 --- a/docs/resources/changelog.md +++ b/docs/resources/changelog.md @@ -8,6 +8,7 @@ _During the beta period, these restrictions may be relaxed in the event of a mis ## Next +- 🚨 BREAKING: removed status from the `sl-error` event payload in `` - Added the experimental `` component - Added `button-group` and `button-group__base` parts to `` - Fixed a bug that prevented form submission from working as expected in some cases diff --git a/src/components/icon/icon.ts b/src/components/icon/icon.ts index 0fb1d894..617747cb 100644 --- a/src/components/icon/icon.ts +++ b/src/components/icon/icon.ts @@ -15,7 +15,7 @@ const parser = new DOMParser(); * @status stable * * @event sl-load - Emitted when the icon has loaded. - * @event {{ status: number }} sl-error - Emitted when the icon fails to load due to an error. + * @event sl-error - Emitted when the icon fails to load due to an error. * * @csspart base - The component's internal wrapper. */ @@ -86,19 +86,18 @@ export default class SlIcon extends LitElement { if (svgEl !== null) { library?.mutator?.(svgEl); - this.svg = svgEl.outerHTML; emit(this, 'sl-load'); } else { this.svg = ''; - emit(this, 'sl-error', { detail: { status: file.status } }); + emit(this, 'sl-error'); } } else { this.svg = ''; - emit(this, 'sl-error', { detail: { status: file.status } }); + emit(this, 'sl-error'); } } catch { - emit(this, 'sl-error', { detail: { status: -1 } }); + emit(this, 'sl-error'); } } else if (this.svg.length > 0) { // If we can't resolve a URL and an icon was previously set, remove it