Title: DocumentFragment missing getElementById() · Issue #14499 · microsoft/TypeScript · GitHub
Open Graph Title: DocumentFragment missing getElementById() · Issue #14499 · microsoft/TypeScript
X Title: DocumentFragment missing getElementById() · Issue #14499 · microsoft/TypeScript
Description: TypeScript Version: 2.2.1 Code class FragmentBug extends HTMLElement{ constructor(){ super(); const shadowRoot = this.attachShadow({mode: 'open'}); shadowRoot.innerHTML = ` `; const p = document.createElement("p"); ...
Open Graph Description: TypeScript Version: 2.2.1 Code class FragmentBug extends HTMLElement{ constructor(){ super(); const shadowRoot = this.attachShadow({mode: 'open'}); shadowRoot.innerHTML = ` `;...
X Description: TypeScript Version: 2.2.1 Code class FragmentBug extends HTMLElement{ constructor(){ super(); const shadowRoot = this.attachShadow({mode: 'open'}); shadowRoot.innerHTML = ` <div id="...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/14499
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"DocumentFragment missing getElementById()","articleBody":"**TypeScript Version:** 2.2.1\r\n\r\n**Code**\r\n\r\n```ts\r\nclass FragmentBug extends HTMLElement{\r\n constructor(){\r\n super();\r\n const shadowRoot = this.attachShadow({mode: 'open'});\r\n shadowRoot.innerHTML = `\r\n \u003cdiv id=\"byid\">\u003c/div>\r\n `;\r\n const p = document.createElement(\"p\");\r\n this.shadowRoot.getElementById(\"byid\").appendChild(p);\r\n /*ERROR: Property 'getElementById' does not exist on type 'ShadowRoot'.*/\r\n }\r\n};\r\ncustomElements.define('fragment-bug', FragmentBug);\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nShadowRoot inherits getElementById() from DocumentFragment, which returns an Element, and appends a `\u003cp>` tag to the `\u003cdiv>`\r\n\r\n[MDN DocumentFragment](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment)\r\n\r\n**Actual behavior:**\r\n\r\nerror TS2339: Property 'getElementById' does not exist on type 'ShadowRoot'.","author":{"url":"https://github.com/arjunyel","@type":"Person","name":"arjunyel"},"datePublished":"2017-03-07T03:28:16Z","url":"https://github.com/microsoft/TypeScript/issues/14499"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:06abc7ac-9dc7-1593-8093-718a883dbc9b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A8AA:3F4253:2998CA0:376CC4C:6B01BCF7 |
| html-safe-nonce | f9df06df762776b359e7b34f3fa310af926054b7b0a3c4f2aca695351dda299b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOEFBOjNGNDI1MzoyOTk4Q0EwOjM3NkNDNEM6NkIwMUJDRjciLCJ2aXNpdG9yX2lkIjoiNDkxMDEzOTczMTc3NjQ2MzI3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6443875338d10e18a58f3c426aa7291477a8341536c6d8ac2aa0947bd1072534 |
| hovercard-subject-tag | issue:212320463 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/14499/issue_layout |
| twitter:image | https://opengraph.githubassets.com/861e0fb626993cd1377e3a46fc125a93fabf566aeb14cf857608c3de5fdfabbb/microsoft/TypeScript/issues/14499 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/861e0fb626993cd1377e3a46fc125a93fabf566aeb14cf857608c3de5fdfabbb/microsoft/TypeScript/issues/14499 |
| og:image:alt | TypeScript Version: 2.2.1 Code class FragmentBug extends HTMLElement{ constructor(){ super(); const shadowRoot = this.attachShadow({mode: 'open'}); shadowRoot.innerHTML = ` `;... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | arjunyel |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width