@y14e/roving-tabindex 1.1.0 → 1.1.1
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/dist/index.cjs +3 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -239,11 +239,11 @@ function createRovingTabIndex(container, options = {}) {
|
|
|
239
239
|
throw new Error("Invalid container element");
|
|
240
240
|
}
|
|
241
241
|
const { direction, selector, typeahead = false, wrap = false } = options;
|
|
242
|
-
if (direction && !["horizontal", "vertical"].includes(direction)) {
|
|
242
|
+
if (typeof direction !== "undefined" && !["horizontal", "vertical"].includes(direction)) {
|
|
243
243
|
console.warn("Invalid direction. Fallback: both (undefined).");
|
|
244
244
|
Object.assign(options, { direction: void 0 });
|
|
245
245
|
}
|
|
246
|
-
if (typeof selector !== "string") {
|
|
246
|
+
if (typeof selector !== "undefined" && typeof selector !== "string") {
|
|
247
247
|
console.warn("Invalid selector. Fallback: all focusable elements.");
|
|
248
248
|
Object.assign(options, { selector: void 0 });
|
|
249
249
|
}
|
|
@@ -444,7 +444,7 @@ function getActiveElement() {
|
|
|
444
444
|
* Lightweight roving tabindex utility with fully focus management.
|
|
445
445
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
446
446
|
*
|
|
447
|
-
* @version 1.1.
|
|
447
|
+
* @version 1.1.1
|
|
448
448
|
* @author Yusuke Kamiyamane
|
|
449
449
|
* @license MIT
|
|
450
450
|
* @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 1.1.
|
|
6
|
+
* @version 1.1.1
|
|
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 1.1.
|
|
6
|
+
* @version 1.1.1
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.js
CHANGED
|
@@ -237,11 +237,11 @@ function createRovingTabIndex(container, options = {}) {
|
|
|
237
237
|
throw new Error("Invalid container element");
|
|
238
238
|
}
|
|
239
239
|
const { direction, selector, typeahead = false, wrap = false } = options;
|
|
240
|
-
if (direction && !["horizontal", "vertical"].includes(direction)) {
|
|
240
|
+
if (typeof direction !== "undefined" && !["horizontal", "vertical"].includes(direction)) {
|
|
241
241
|
console.warn("Invalid direction. Fallback: both (undefined).");
|
|
242
242
|
Object.assign(options, { direction: void 0 });
|
|
243
243
|
}
|
|
244
|
-
if (typeof selector !== "string") {
|
|
244
|
+
if (typeof selector !== "undefined" && typeof selector !== "string") {
|
|
245
245
|
console.warn("Invalid selector. Fallback: all focusable elements.");
|
|
246
246
|
Object.assign(options, { selector: void 0 });
|
|
247
247
|
}
|
|
@@ -442,7 +442,7 @@ function getActiveElement() {
|
|
|
442
442
|
* Lightweight roving tabindex utility with fully focus management.
|
|
443
443
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
444
444
|
*
|
|
445
|
-
* @version 1.1.
|
|
445
|
+
* @version 1.1.1
|
|
446
446
|
* @author Yusuke Kamiyamane
|
|
447
447
|
* @license MIT
|
|
448
448
|
* @copyright Copyright (c) Yusuke Kamiyamane
|