pull/1927/head
konnorrogers 2024-03-15 16:42:32 -04:00
rodzic 27c0cc81c5
commit 37b25b8809
3 zmienionych plików z 8 dodań i 9 usunięć

Wyświetl plik

@ -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 `<sl-popup>` [#1874]
- Fixed a bug in `<sl-icon>` that did not properly apply mutators to spritesheets. [#]
- Fixed a bug in `<sl-icon>` that did not properly apply mutators to spritesheets. [#1927]
- Fixed a bug in `.sl-scroll-lock` causing layout shifts. [#1895]
- Fixed a bug in `<sl-rating>` that caused the rating to not reset in some circumstances [#1877]
- Fixed a bug in `<sl-select>` 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
- Initial release

Wyświetl plik

@ -46,18 +46,17 @@ export default class SlIcon extends ShoelaceElement {
<use part="use" href="${url}"></use>
</svg>`;
// 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 {

Wyświetl plik

@ -207,7 +207,7 @@ describe('<sl-icon>', () => {
// 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: <use> svg icons don't emit a "load" or "error" event...if we can figure out how to get the event to emit errors.