drab 7.0.2 → 7.0.3

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.
@@ -73,8 +73,8 @@ export class Dialog extends Lifecycle(Trigger(Content())) {
73
73
  let rect = this.#dialog.getBoundingClientRect();
74
74
  // If dialog covers full viewport, use first child element for hit testing
75
75
  // Example: https://picocss.com/docs/modal
76
- if (Math.abs(rect.width - window.innerWidth) <= this.#scrollbarWidth && // 5px tolerance for rounding issues
77
- Math.abs(rect.height - window.innerHeight) <= 0 &&
76
+ if (window.innerWidth - rect.width <= this.#scrollbarWidth + 3 &&
77
+ window.innerHeight - rect.height <= 3 &&
78
78
  this.#dialog.firstElementChild) {
79
79
  rect = this.#dialog.firstElementChild.getBoundingClientRect();
80
80
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tabs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE9E,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACxD,4DAA4D;IAC5D,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,IAAK,SAAQ,SAAoB;;;IAkDpC,KAAK;CA4Fd"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "drab",
3
3
  "description": "Interactivity for You",
4
- "version": "7.0.2",
4
+ "version": "7.0.3",
5
5
  "homepage": "https://drab.robino.dev",
6
6
  "license": "MIT",
7
7
  "author": {
@@ -99,8 +99,8 @@ export class Dialog extends Lifecycle(Trigger(Content())) {
99
99
  // If dialog covers full viewport, use first child element for hit testing
100
100
  // Example: https://picocss.com/docs/modal
101
101
  if (
102
- Math.abs(rect.width - window.innerWidth) <= this.#scrollbarWidth && // 5px tolerance for rounding issues
103
- Math.abs(rect.height - window.innerHeight) <= 0 &&
102
+ window.innerWidth - rect.width <= this.#scrollbarWidth + 3 &&
103
+ window.innerHeight - rect.height <= 3 &&
104
104
  this.#dialog.firstElementChild
105
105
  ) {
106
106
  rect = this.#dialog.firstElementChild.getBoundingClientRect();
package/src/tabs/index.ts CHANGED
@@ -86,13 +86,18 @@ export class Tabs extends Lifecycle(Trigger()) {
86
86
  override mount() {
87
87
  // create tablist
88
88
  const [first, ...rest] = this.#tabs;
89
+
89
90
  let common = this.#ancestors(first);
91
+
90
92
  for (let i = 0; i < rest.length; i++) {
91
93
  common = common.intersection(this.#ancestors(rest[i]));
92
94
  }
95
+
93
96
  const [tablist] = common;
97
+
94
98
  if (!tablist)
95
99
  throw new Error("Tabs: No common parent element found for triggers.");
100
+
96
101
  tablist.role = "tablist";
97
102
  tablist.ariaOrientation = this.#orientation;
98
103