kopia lustrzana https://github.com/shoelace-style/shoelace
remove sl-error payload
rodzic
eb66ce2d4b
commit
13b2f8018d
|
@ -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 `<sl-icon>`
|
||||
- Added the experimental `<sl-radio-button>` component
|
||||
- Added `button-group` and `button-group__base` parts to `<sl-radio-group>`
|
||||
- Fixed a bug that prevented form submission from working as expected in some cases
|
||||
|
|
|
@ -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
|
||||
|
|
Ładowanie…
Reference in New Issue