Closed fabiancook closed 2 years ago
https://github.com/b-fuze/deno-dom/blob/af5626565c747c027a2fe8fb76bd3ac84673c738/src/dom/element.ts#L306
Instead of setAttribute("id", this.#currentId = id), the above code is used.
setAttribute("id", this.#currentId = id)
I checked this here:
const div: HTMLElement = <div /> console.log({ div, instance: div instanceof HTMLElement }); const expectedId = `${Math.random()}` div.id = expectedId; console.log({ id: div.getAttribute("id"), [expectedId]: div.getAttribute(expectedId) }); ok(div.getAttribute("id") === expectedId || div.getAttribute(expectedId) === expectedId);
We get the log
{ div: EventTarget { .... }, instance: true } { id: null, "0.5037532964515365": "0.5037532964515365" }
Resolve with https://github.com/b-fuze/deno-dom/pull/84
https://github.com/b-fuze/deno-dom/blob/af5626565c747c027a2fe8fb76bd3ac84673c738/src/dom/element.ts#L306
Instead of
setAttribute("id", this.#currentId = id)
, the above code is used.I checked this here:
We get the log