@vaadin/a11y-base 25.0.0-beta1 → 25.0.0-beta3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/a11y-base",
3
- "version": "25.0.0-beta1",
3
+ "version": "25.0.0-beta3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -31,14 +31,14 @@
31
31
  ],
32
32
  "dependencies": {
33
33
  "@open-wc/dedupe-mixin": "^1.3.0",
34
- "@vaadin/component-base": "25.0.0-beta1",
34
+ "@vaadin/component-base": "25.0.0-beta3",
35
35
  "lit": "^3.0.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@vaadin/chai-plugins": "25.0.0-beta1",
39
- "@vaadin/test-runner-commands": "25.0.0-beta1",
38
+ "@vaadin/chai-plugins": "25.0.0-beta3",
39
+ "@vaadin/test-runner-commands": "25.0.0-beta3",
40
40
  "@vaadin/testing-helpers": "^2.0.0",
41
41
  "sinon": "^21.0.0"
42
42
  },
43
- "gitHead": "1d20cf54e582d1f2e209126d4586f8b4c01c50e0"
43
+ "gitHead": "4b2006b0e2f4fc131f5483223b852d34224e7b9a"
44
44
  }
@@ -44,15 +44,23 @@ export const KeyboardDirectionMixin = (superclass) =>
44
44
  * @override
45
45
  */
46
46
  focus(options) {
47
- const items = this._getItems();
48
- if (Array.isArray(items)) {
49
- const idx = this._getAvailableIndex(items, 0, null, (item) => !isElementHidden(item));
50
- if (idx >= 0) {
51
- this._focus(idx, options);
52
- }
47
+ const idx = this._getFocusableIndex();
48
+ if (idx >= 0) {
49
+ this._focus(idx, options);
53
50
  }
54
51
  }
55
52
 
53
+ /**
54
+ * Get the index of a first focusable item, if any.
55
+ *
56
+ * @return {Element[]}
57
+ * @protected
58
+ */
59
+ _getFocusableIndex() {
60
+ const items = this._getItems();
61
+ return Array.isArray(items) ? this._getAvailableIndex(items, 0, null, (item) => !isElementHidden(item)) : -1;
62
+ }
63
+
56
64
  /**
57
65
  * Get the list of items participating in keyboard navigation.
58
66
  * By default, it treats all the light DOM children as items.