turns out, we don't need this

This commit is contained in:
Hamcha 2024-10-12 23:32:22 +02:00
parent f03c6475bc
commit c4375737bc
Signed by: hamcha
GPG key ID: 1669C533B8CF6D89

View file

@ -57,16 +57,11 @@ export function $el<T extends keyof HTMLElementTagNameMap>(
for (const key in value as Record<string, unknown>) { for (const key in value as Record<string, unknown>) {
el.dataset[key] = (value as Record<string, string>)[key]; el.dataset[key] = (value as Record<string, string>)[key];
} }
} else {
// For some tricky attributes, set them the old fashioned way using strings
if (typeof value === "string") {
el.setAttribute(attr, value as string);
} else { } else {
el[attr as keyof HTMLElementTagNameMap[T]] = el[attr as keyof HTMLElementTagNameMap[T]] =
value as HTMLElementTagNameMap[T][keyof HTMLElementTagNameMap[T]]; value as HTMLElementTagNameMap[T][keyof HTMLElementTagNameMap[T]];
} }
} }
}
desc.shift(); desc.shift();
} }