From 37b25b880921475fd097f0cb4008ddd6145bcf72 Mon Sep 17 00:00:00 2001 From: konnorrogers Date: Fri, 15 Mar 2024 16:42:32 -0400 Subject: [PATCH] prettier --- docs/pages/resources/changelog.md | 4 ++-- src/components/icon/icon.component.ts | 11 +++++------ src/components/icon/icon.test.ts | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/docs/pages/resources/changelog.md b/docs/pages/resources/changelog.md index 9c9ad41f..01a6440a 100644 --- a/docs/pages/resources/changelog.md +++ b/docs/pages/resources/changelog.md @@ -16,7 +16,7 @@ New versions of Shoelace are released as-needed and generally occur when a criti - Added the Slovenian translation [#1893] - Added support for `contextElement` to `VirtualElements` in `` [#1874] -- Fixed a bug in `` that did not properly apply mutators to spritesheets. [#] +- Fixed a bug in `` that did not properly apply mutators to spritesheets. [#1927] - Fixed a bug in `.sl-scroll-lock` causing layout shifts. [#1895] - Fixed a bug in `` that caused the rating to not reset in some circumstances [#1877] - Fixed a bug in `` that caused the menu to not close when rendered in a shadow root [#1878] @@ -1732,4 +1732,4 @@ The following pages demonstrate why this change was necessary. ## 2.0.0-beta.1 -- Initial release \ No newline at end of file +- Initial release diff --git a/src/components/icon/icon.component.ts b/src/components/icon/icon.component.ts index 25954311..7b2878dc 100644 --- a/src/components/icon/icon.component.ts +++ b/src/components/icon/icon.component.ts @@ -46,18 +46,17 @@ export default class SlIcon extends ShoelaceElement { `; - // Using a templateResult requires the SVG to be written to the DOM first before we can grab the SVGElement // to be passed to the library's mutator function. - await this.updateComplete + await this.updateComplete; - const svg = this.shadowRoot?.querySelector("[part='svg']") as SVGSVGElement + const svg = this.shadowRoot!.querySelector("[part='svg']")!; - if (typeof library.mutator === "function") { - library.mutator(svg) + if (typeof library.mutator === 'function') { + library.mutator(svg as SVGElement); } - return this.svg + return this.svg; } try { diff --git a/src/components/icon/icon.test.ts b/src/components/icon/icon.test.ts index 2b960d7d..0361c83d 100644 --- a/src/components/icon/icon.test.ts +++ b/src/components/icon/icon.test.ts @@ -207,7 +207,7 @@ describe('', () => { // Make sure the mutator is applied. // https://github.com/shoelace-style/shoelace/issues/1925 - expect(svg?.getAttribute("fill")).to.equal("currentColor") + expect(svg?.getAttribute('fill')).to.equal('currentColor'); }); // TODO: svg icons don't emit a "load" or "error" event...if we can figure out how to get the event to emit errors.