@vaadin/a11y-base
Advanced tools
+1
-1
@@ -8,3 +8,3 @@ export { announce } from './src/announce.js'; | ||
| export { | ||
| getFocusableElements, | ||
| getTabbableElements, | ||
| isElementFocusable, | ||
@@ -11,0 +11,0 @@ isElementFocused, |
+1
-1
@@ -10,3 +10,3 @@ export { announce } from './src/announce.js'; | ||
| export { | ||
| getFocusableElements, | ||
| getTabbableElements, | ||
| isElementFocusable, | ||
@@ -13,0 +13,0 @@ isElementFocused, |
+5
-5
| { | ||
| "name": "@vaadin/a11y-base", | ||
| "version": "25.3.0-alpha4", | ||
| "version": "25.3.0-alpha5", | ||
| "publishConfig": { | ||
@@ -35,8 +35,8 @@ "access": "public" | ||
| "@open-wc/dedupe-mixin": "^1.3.0", | ||
| "@vaadin/component-base": "25.3.0-alpha4", | ||
| "@vaadin/component-base": "25.3.0-alpha5", | ||
| "lit": "^3.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@vaadin/chai-plugins": "25.3.0-alpha4", | ||
| "@vaadin/test-runner-commands": "25.3.0-alpha4", | ||
| "@vaadin/chai-plugins": "25.3.0-alpha5", | ||
| "@vaadin/test-runner-commands": "25.3.0-alpha5", | ||
| "@vaadin/testing-helpers": "^2.0.0", | ||
@@ -46,3 +46,3 @@ "sinon": "^22.0.0" | ||
| "customElements": "custom-elements.json", | ||
| "gitHead": "ff0efcd52d3b8a081e8101d36cf7bef65ed71cb1" | ||
| "gitHead": "0be2142cd8b95a562d58735033f947f7109103ab" | ||
| } |
@@ -6,3 +6,3 @@ /** | ||
| */ | ||
| import { getFocusableElements, isElementFocused, isKeyboardActive } from './focus-utils.js'; | ||
| import { getTabbableElements, isElementFocused, isKeyboardActive } from './focus-utils.js'; | ||
@@ -61,3 +61,3 @@ const instances = []; | ||
| get __focusableElements() { | ||
| return getFocusableElements(this.__trapNode); | ||
| return getTabbableElements(this.__trapNode); | ||
| } | ||
@@ -64,0 +64,0 @@ |
@@ -29,3 +29,4 @@ /** | ||
| /** | ||
| * Returns true if the element is focusable, otherwise false. | ||
| * Returns true if the element is focusable, i.e. can be focused with a | ||
| * mouse click or a `focus()` call, otherwise false. | ||
| * | ||
@@ -58,2 +59,2 @@ * The list of focusable elements is taken from http://stackoverflow.com/a/1600194/4228703. | ||
| */ | ||
| export declare function getFocusableElements(element: HTMLElement): HTMLElement[]; | ||
| export declare function getTabbableElements(element: HTMLElement): HTMLElement[]; |
@@ -168,3 +168,4 @@ /** | ||
| /** | ||
| * Returns true if the element is focusable, otherwise false. | ||
| * Returns true if the element is focusable, i.e. can be focused with a | ||
| * mouse click or a `focus()` call, otherwise false. | ||
| * | ||
@@ -188,7 +189,2 @@ * The list of focusable elements is taken from http://stackoverflow.com/a/1600194/4228703. | ||
| export function isElementFocusable(element) { | ||
| // The element cannot be focused if its `tabindex` attribute is set to `-1`. | ||
| if (element.matches('[tabindex="-1"]')) { | ||
| return false; | ||
| } | ||
| // Elements that cannot be focused if they have a `disabled` attribute. | ||
@@ -276,3 +272,3 @@ if (element.matches('input, select, textarea, button, object')) { | ||
| */ | ||
| export function getFocusableElements(element) { | ||
| export function getTabbableElements(element) { | ||
| const focusableElements = []; | ||
@@ -279,0 +275,0 @@ const needsSortByTabIndex = collectFocusableNodes(element, focusableElements); |
@@ -39,2 +39,7 @@ /** | ||
| /** | ||
| * Used for mixin detection because `instanceof` does not work with mixins. | ||
| */ | ||
| protected _hasVaadinListMixin: boolean; | ||
| /** | ||
| * A read-only list of items from which a selection can be made. | ||
@@ -41,0 +46,0 @@ * It is populated from the elements passed to the light DOM, |
+10
-0
@@ -80,2 +80,12 @@ /** | ||
| constructor() { | ||
| super(); | ||
| /** | ||
| * Used for mixin detection because `instanceof` does not work with mixins. | ||
| * @protected | ||
| */ | ||
| this._hasVaadinListMixin = true; | ||
| } | ||
| /** | ||
@@ -82,0 +92,0 @@ * @return {boolean} |
119878
0.26%3303
0.3%+ Added
- Removed