ToSvelte will now bind directly to svelte in the case that a SvelteUIElement is passed. This helps with cleaning up MapLibre maps, which should help with #2024

This commit is contained in:
Pieter Vander Vennet 2024-07-16 14:45:29 +02:00
parent 7038fcc6f6
commit 7d678d95c7
4 changed files with 54 additions and 18 deletions

View file

@ -63,7 +63,7 @@ export default abstract class BaseUIElement {
/**
* Adds all the relevant classes, space separated
*/
public SetClass(clss: string) {
public SetClass(clss: string): this {
if (clss == undefined) {
return this
}
@ -101,7 +101,7 @@ export default abstract class BaseUIElement {
return this.clss.has(clss)
}
public SetStyle(style: string): BaseUIElement {
public SetStyle(style: string): this {
this.style = style
if (this._constructedHtmlElement !== undefined) {
this._constructedHtmlElement.style.cssText = style