@y14e/roving-tabindex 2.0.5 → 2.0.7

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/README.md CHANGED
@@ -10,14 +10,14 @@ npm i @y14e/roving-tabindex
10
10
 
11
11
  ```ts
12
12
  // npm
13
- import { createRovingTabIndex } from '@y14e/roving-tabindex@2.0.5';
13
+ import { createRovingTabIndex } from '@y14e/roving-tabindex@2.0.7';
14
14
 
15
15
  // CDNs
16
- import { createRovingTabIndex } from 'https://esm.sh/@y14e/roving-tabindex@2.0.5';
16
+ import { createRovingTabIndex } from 'https://esm.sh/@y14e/roving-tabindex@2.0.7';
17
17
  // or
18
- import { createRovingTabIndex } from 'https://cdn.jsdelivr.net/npm/@y14e/roving-tabindex@2.0.5/+esm';
18
+ import { createRovingTabIndex } from 'https://cdn.jsdelivr.net/npm/@y14e/roving-tabindex@2.0.7/+esm';
19
19
  // or
20
- import { createRovingTabIndex } from 'https://esm.unpkg.com/@y14e/roving-tabindex@2.0.5';
20
+ import { createRovingTabIndex } from 'https://esm.unpkg.com/@y14e/roving-tabindex@2.0.7';
21
21
  ```
22
22
 
23
23
  ## 📦 APIs
package/dist/index.cjs CHANGED
@@ -327,12 +327,8 @@ function createRovingTabIndex(container, options = {}) {
327
327
  wrap = false;
328
328
  }
329
329
  const settings = { navigationOnly, typeahead, wrap };
330
- if (direction) {
331
- Object.assign(settings, { direction });
332
- }
333
- if (selector) {
334
- Object.assign(settings, { selector });
335
- }
330
+ direction && Object.assign(settings, { direction });
331
+ selector && Object.assign(settings, { selector });
336
332
  const roving = new RovingTabIndex(container, settings);
337
333
  return () => roving.destroy();
338
334
  }
@@ -444,10 +440,7 @@ var RovingTabIndex = class {
444
440
  }
445
441
  }
446
442
  const focusable = target.at(newIndex);
447
- if (!focusable) {
448
- return;
449
- }
450
- focusElement(focusable);
443
+ focusable && focusElement(focusable);
451
444
  };
452
445
  #update(active) {
453
446
  const current = new Set(this.#getFocusables());
@@ -514,7 +507,8 @@ var RovingTabIndex = class {
514
507
  return getFocusables(this.#container, {
515
508
  composed: true,
516
509
  filter: this.#selectorFilter,
517
- skipNegativeTabIndexCheck: !this.#options.navigationOnly
510
+ skipNegativeTabIndexCheck: !this.#options.navigationOnly,
511
+ skipVisibilityCheck: true
518
512
  });
519
513
  }
520
514
  };
@@ -533,7 +527,7 @@ function getActiveElement() {
533
527
  * Lightweight roving tabindex utility with fully focus management.
534
528
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
535
529
  *
536
- * @version 2.0.5
530
+ * @version 2.0.7
537
531
  * @author Yusuke Kamiyamane
538
532
  * @license MIT
539
533
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.cts CHANGED
@@ -3,7 +3,7 @@
3
3
  * Lightweight roving tabindex utility with fully focus management.
4
4
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
5
5
  *
6
- * @version 2.0.5
6
+ * @version 2.0.7
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * Lightweight roving tabindex utility with fully focus management.
4
4
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
5
5
  *
6
- * @version 2.0.5
6
+ * @version 2.0.7
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.js CHANGED
@@ -325,12 +325,8 @@ function createRovingTabIndex(container, options = {}) {
325
325
  wrap = false;
326
326
  }
327
327
  const settings = { navigationOnly, typeahead, wrap };
328
- if (direction) {
329
- Object.assign(settings, { direction });
330
- }
331
- if (selector) {
332
- Object.assign(settings, { selector });
333
- }
328
+ direction && Object.assign(settings, { direction });
329
+ selector && Object.assign(settings, { selector });
334
330
  const roving = new RovingTabIndex(container, settings);
335
331
  return () => roving.destroy();
336
332
  }
@@ -442,10 +438,7 @@ var RovingTabIndex = class {
442
438
  }
443
439
  }
444
440
  const focusable = target.at(newIndex);
445
- if (!focusable) {
446
- return;
447
- }
448
- focusElement(focusable);
441
+ focusable && focusElement(focusable);
449
442
  };
450
443
  #update(active) {
451
444
  const current = new Set(this.#getFocusables());
@@ -512,7 +505,8 @@ var RovingTabIndex = class {
512
505
  return getFocusables(this.#container, {
513
506
  composed: true,
514
507
  filter: this.#selectorFilter,
515
- skipNegativeTabIndexCheck: !this.#options.navigationOnly
508
+ skipNegativeTabIndexCheck: !this.#options.navigationOnly,
509
+ skipVisibilityCheck: true
516
510
  });
517
511
  }
518
512
  };
@@ -531,7 +525,7 @@ function getActiveElement() {
531
525
  * Lightweight roving tabindex utility with fully focus management.
532
526
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
533
527
  *
534
- * @version 2.0.5
528
+ * @version 2.0.7
535
529
  * @author Yusuke Kamiyamane
536
530
  * @license MIT
537
531
  * @copyright Copyright (c) Yusuke Kamiyamane
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@y14e/roving-tabindex",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "Lightweight roving tabindex utility with fully focus management",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",