Basic info:
Attempting to assign ARIA properties on ElementInternals for custom elements results in an error:
Error: Uncaught [TypeError: Cannot read properties of undefined (reading 'set')]
- Node.js version: 21.6.2
- jsdom version: 24.1.0
Minimal reproduction case
const { JSDOM } = require("jsdom");
new JSDOM(
`
<!DOCTYPE html>
<title></title>
<script>
class ExampleElement extends HTMLElement {
constructor() {
super();
const internals = this.attachInternals();
internals.role = 'button';
}
}
customElements.define('example-element', ExampleElement);
</script>
<example-element></example-element>
`,
{
runScripts: "dangerously",
}
);
How does similar code behave in browsers?
CodePen example
Basic info:
Attempting to assign ARIA properties on ElementInternals for custom elements results in an error:
Minimal reproduction case
How does similar code behave in browsers?
CodePen example