element-internals-polyfill
Advanced tools
Comparing version 0.1.51 to 0.1.52
@@ -151,5 +151,2 @@ (function () { | ||
} | ||
else if (!parent && elem.toString() === '[object ShadowRoot]') { | ||
parent = findParentForm(elem.host); | ||
} | ||
return parent; | ||
@@ -156,0 +153,0 @@ }; |
{ | ||
"name": "element-internals-polyfill", | ||
"version": "0.1.51", | ||
"version": "0.1.52", | ||
"description": "A polyfill for the element internals specification", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -135,2 +135,20 @@ # Element Internals Polyfill | ||
For example, if you are creating a control that has a checked property, you will likely could set the `internals.ariaChecked` property to `'true'`. In polyfilled browsers, this will result in adding `aria-checked="true"` to the host's attributes. In fully-supported browsers, this attribute will not be reflected although the checked property will be reflected in the accessibility object model. | ||
```javascript | ||
class CheckedControl extends HTMLElement { | ||
#checked = false; | ||
#internals = this.attachInternals(); | ||
get checked() { | ||
return this.#checked; | ||
} | ||
set checked(isChecked) { | ||
this.#checked = isChecked; | ||
this.#internals.ariaChecked = isChecked.toString(); | ||
} | ||
} | ||
``` | ||
### State API | ||
@@ -137,0 +155,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51927
13
193
943