@y14e/tabs 1.3.4 → 1.3.6

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 CHANGED
@@ -324,7 +324,8 @@ var Tabs = class _Tabs {
324
324
  this.#rootElement.removeAttribute("data-tabs-initialized");
325
325
  }
326
326
  #initialize() {
327
- const { signal } = this.#eventController ?? new AbortController();
327
+ this.#eventController = new AbortController();
328
+ const { signal } = this.#eventController;
328
329
  saveAttributes(this.#listElements, [
329
330
  "aria-hidden",
330
331
  "aria-orientation",
@@ -405,6 +406,10 @@ var Tabs = class _Tabs {
405
406
  this.activate(tab);
406
407
  };
407
408
  #onTabKeyDown = (event) => {
409
+ const { key, altKey, ctrlKey, metaKey, shiftKey } = event;
410
+ if (altKey || ctrlKey || metaKey || shiftKey) {
411
+ return;
412
+ }
408
413
  const currentTab = event.currentTarget;
409
414
  if (!(currentTab instanceof HTMLElement)) {
410
415
  return;
@@ -415,7 +420,6 @@ var Tabs = class _Tabs {
415
420
  }
416
421
  const isBoth = list.ariaOrientation === "undefined";
417
422
  const isHorizontal = list.ariaOrientation !== "vertical";
418
- const { key } = event;
419
423
  if (![
420
424
  "Enter",
421
425
  " ",
@@ -614,7 +618,7 @@ function isFocusable(element) {
614
618
  * Tabs
615
619
  * WAI-ARIA compliant tabs pattern implementation in TypeScript.
616
620
  *
617
- * @version 1.3.4
621
+ * @version 1.3.6
618
622
  * @author Yusuke Kamiyamane
619
623
  * @license MIT
620
624
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.cts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Tabs
3
3
  * WAI-ARIA compliant tabs pattern implementation in TypeScript.
4
4
  *
5
- * @version 1.3.4
5
+ * @version 1.3.6
6
6
  * @author Yusuke Kamiyamane
7
7
  * @license MIT
8
8
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Tabs
3
3
  * WAI-ARIA compliant tabs pattern implementation in TypeScript.
4
4
  *
5
- * @version 1.3.4
5
+ * @version 1.3.6
6
6
  * @author Yusuke Kamiyamane
7
7
  * @license MIT
8
8
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.js CHANGED
@@ -322,7 +322,8 @@ var Tabs = class _Tabs {
322
322
  this.#rootElement.removeAttribute("data-tabs-initialized");
323
323
  }
324
324
  #initialize() {
325
- const { signal } = this.#eventController ?? new AbortController();
325
+ this.#eventController = new AbortController();
326
+ const { signal } = this.#eventController;
326
327
  saveAttributes(this.#listElements, [
327
328
  "aria-hidden",
328
329
  "aria-orientation",
@@ -403,6 +404,10 @@ var Tabs = class _Tabs {
403
404
  this.activate(tab);
404
405
  };
405
406
  #onTabKeyDown = (event) => {
407
+ const { key, altKey, ctrlKey, metaKey, shiftKey } = event;
408
+ if (altKey || ctrlKey || metaKey || shiftKey) {
409
+ return;
410
+ }
406
411
  const currentTab = event.currentTarget;
407
412
  if (!(currentTab instanceof HTMLElement)) {
408
413
  return;
@@ -413,7 +418,6 @@ var Tabs = class _Tabs {
413
418
  }
414
419
  const isBoth = list.ariaOrientation === "undefined";
415
420
  const isHorizontal = list.ariaOrientation !== "vertical";
416
- const { key } = event;
417
421
  if (![
418
422
  "Enter",
419
423
  " ",
@@ -612,7 +616,7 @@ function isFocusable(element) {
612
616
  * Tabs
613
617
  * WAI-ARIA compliant tabs pattern implementation in TypeScript.
614
618
  *
615
- * @version 1.3.4
619
+ * @version 1.3.6
616
620
  * @author Yusuke Kamiyamane
617
621
  * @license MIT
618
622
  * @copyright Copyright (c) Yusuke Kamiyamane
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@y14e/tabs",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "description": "WAI-ARIA compliant tabs pattern implementation in TypeScript",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",