@y14e/roving-tabindex 2.0.3 → 2.0.4
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 +4 -4
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/package.json +1 -1
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.
|
|
13
|
+
import { createRovingTabIndex } from '@y14e/roving-tabindex@2.0.4';
|
|
14
14
|
|
|
15
15
|
// CDNs
|
|
16
|
-
import { createRovingTabIndex } from 'https://esm.sh/@y14e/roving-tabindex@2.0.
|
|
16
|
+
import { createRovingTabIndex } from 'https://esm.sh/@y14e/roving-tabindex@2.0.4';
|
|
17
17
|
// or
|
|
18
|
-
import { createRovingTabIndex } from 'https://cdn.jsdelivr.net/npm/@y14e/roving-tabindex@2.0.
|
|
18
|
+
import { createRovingTabIndex } from 'https://cdn.jsdelivr.net/npm/@y14e/roving-tabindex@2.0.4/+esm';
|
|
19
19
|
// or
|
|
20
|
-
import { createRovingTabIndex } from 'https://esm.unpkg.com/@y14e/roving-tabindex@2.0.
|
|
20
|
+
import { createRovingTabIndex } from 'https://esm.unpkg.com/@y14e/roving-tabindex@2.0.4';
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## 📦 APIs
|
package/dist/index.cjs
CHANGED
|
@@ -312,7 +312,7 @@ function createRovingTabIndex(container, options = {}) {
|
|
|
312
312
|
console.warn("Invalid navigationOnly option. Fallback: false.");
|
|
313
313
|
navigationOnly = false;
|
|
314
314
|
}
|
|
315
|
-
if (typeof selector !== "undefined" && typeof selector !== "string") {
|
|
315
|
+
if (typeof selector !== "undefined" && (typeof selector !== "string" || !selector.trim())) {
|
|
316
316
|
console.warn(
|
|
317
317
|
"Invalid selector. Fallback: all focusable elements (undefined)."
|
|
318
318
|
);
|
|
@@ -327,10 +327,10 @@ function createRovingTabIndex(container, options = {}) {
|
|
|
327
327
|
wrap = false;
|
|
328
328
|
}
|
|
329
329
|
const settings = { navigationOnly, typeahead, wrap };
|
|
330
|
-
if (direction
|
|
330
|
+
if (direction) {
|
|
331
331
|
Object.assign(settings, { direction });
|
|
332
332
|
}
|
|
333
|
-
if (selector
|
|
333
|
+
if (selector) {
|
|
334
334
|
Object.assign(settings, { selector });
|
|
335
335
|
}
|
|
336
336
|
const roving = new RovingTabIndex(container, settings);
|
|
@@ -522,7 +522,7 @@ function getActiveElement() {
|
|
|
522
522
|
* Lightweight roving tabindex utility with fully focus management.
|
|
523
523
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
524
524
|
*
|
|
525
|
-
* @version 2.0.
|
|
525
|
+
* @version 2.0.4
|
|
526
526
|
* @author Yusuke Kamiyamane
|
|
527
527
|
* @license MIT
|
|
528
528
|
* @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.
|
|
6
|
+
* @version 2.0.4
|
|
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.
|
|
6
|
+
* @version 2.0.4
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.js
CHANGED
|
@@ -310,7 +310,7 @@ function createRovingTabIndex(container, options = {}) {
|
|
|
310
310
|
console.warn("Invalid navigationOnly option. Fallback: false.");
|
|
311
311
|
navigationOnly = false;
|
|
312
312
|
}
|
|
313
|
-
if (typeof selector !== "undefined" && typeof selector !== "string") {
|
|
313
|
+
if (typeof selector !== "undefined" && (typeof selector !== "string" || !selector.trim())) {
|
|
314
314
|
console.warn(
|
|
315
315
|
"Invalid selector. Fallback: all focusable elements (undefined)."
|
|
316
316
|
);
|
|
@@ -325,10 +325,10 @@ function createRovingTabIndex(container, options = {}) {
|
|
|
325
325
|
wrap = false;
|
|
326
326
|
}
|
|
327
327
|
const settings = { navigationOnly, typeahead, wrap };
|
|
328
|
-
if (direction
|
|
328
|
+
if (direction) {
|
|
329
329
|
Object.assign(settings, { direction });
|
|
330
330
|
}
|
|
331
|
-
if (selector
|
|
331
|
+
if (selector) {
|
|
332
332
|
Object.assign(settings, { selector });
|
|
333
333
|
}
|
|
334
334
|
const roving = new RovingTabIndex(container, settings);
|
|
@@ -520,7 +520,7 @@ function getActiveElement() {
|
|
|
520
520
|
* Lightweight roving tabindex utility with fully focus management.
|
|
521
521
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
522
522
|
*
|
|
523
|
-
* @version 2.0.
|
|
523
|
+
* @version 2.0.4
|
|
524
524
|
* @author Yusuke Kamiyamane
|
|
525
525
|
* @license MIT
|
|
526
526
|
* @copyright Copyright (c) Yusuke Kamiyamane
|