We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 423d443 commit 85463dbCopy full SHA for 85463db
packages/dom/src/CustomAttribute.ts
@@ -28,8 +28,6 @@ export class CustomAttribute<E extends Element = Element> {
28
}
29
30
constructor(ownerElement: E, name: string, value: string) {
31
- if (!name.includes('-')) throw new Error(`Custom attribute '${name}' must include a hyphen.`);
32
-
33
this.#name = name;
34
this.#value = value;
35
this.#ownerElement = ownerElement;
@@ -135,6 +133,8 @@ export class CustomAttributeRegistry {
135
133
136
134
137
define(attrName: string, Class: typeof CustomAttribute) {
+ if (!attrName.includes('-')) throw new Error(`Custom attribute '${name}' must include a hyphen.`);
+
138
this.#attrMap.set(attrName, Class);
139
this.#upgradeAttr(attrName);
140
this.#observer.disconnect();
0 commit comments