Add ElementInternals, attachInternals from HTML standard
See original GitHub issueTypeScript Version: 3.5.2
Search Terms: ElementInternals, attachInternals
Code
let internals: ElementInternals;
Expected behavior:
No errors. The ElementInternals
interface and the related attachInternals
method on HTMLElement
are recent additions to the DOM spec. They are supported in Chrome 78 (scheduled for public release at the end of October 2019) and Edge canary builds.
Actual behavior:
Error Cannot find name 'ElementInternals'.
Playground Link: https://www.typescriptlang.org/play/#code/DYUwLgBAlgdmICcYENgGcBcECioC2IcAknIiugNwBQQA
Issue Analytics
- State:
- Created 4 years ago
- Reactions:11
- Comments:7 (2 by maintainers)
Top Results From Across the Web
HTMLElement.attachInternals() - Web APIs - MDN Web Docs
The HTMLElement.attachInternals() method returns an ElementInternals object. This method allows a custom element to participate in HTML ...
Read more >4.13 Custom elements - HTML Standard - whatwg
Adding a static formAssociated property, with a true value, ... The ElementInternals interface helps you to implement functions and ...
Read more >Creating Custom Form Controls with ElementInternals
We have also added a second input to our form that is a vanilla HTML input, and added a default value (so you...
Read more >Using Web Components in Angular Forms with Element ...
By default, when creating a Web Component with Shadow DOM, the HTML ... Using the Element Internals API, we can enable our Web...
Read more >ElementInternals.shadowRoot attribute - Chrome Platform Status
Additionally, further restrictions are added to the attachInternals() API to ensure that custom elements get the first chance to attach the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I do not understand how this has not been part of TypeScript yet. My team is developing W3C standard custom elements and the dirty secret is that custom elements by themselves do not play well in forms due to the inaccessibility of the shadow dom. ES6 and all modern browsers support
HTMLElement.attachInternals
, yet we cannot use it in TypeScript? Our team just tried to focus on fixing our components, and I am shocked that this is missing from TypeScript all this time.We need this ASAP, so +1
Meanwhile: