deno-dom
deno-dom copied to clipboard
data-attributes -> dataset
I would like to use this library to help mocking out the dom for deno tests. It seems like dataset properties are not supported?
const h1 = document.querySelector("h1");
h1.setAttribute("data-test", "test");
const result = h1.dataset.test;
dataset seems to be undefined in the element.
Yeah. Dataset looks like it probably needs to be a Proxy
... I'll get to work on it soon
In the meantime, you can use element.attributes.getNamedItem('data-MYVALUE')?.value;
to access data attributes.
No rush (I really appreciate all the work done in this awesome library), but I would like to know if there are plans to implement this feature anytime soon.
This issue prevents to use the latest version of highlight.js, because it usesdataset
to store some data and it fails.
Yeah, I got an implementation ready
thanks so much!