inclusive-elements 0.3.1 → 0.3.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.
@@ -324,7 +324,7 @@ class $ extends HTMLElement {
324
324
  wasOpened() {
325
325
  if (!this.content.hidden)
326
326
  return;
327
- this.content.hidden = !1, this.backdrop.hidden = !1, h(this.content), h(this.backdrop), this.button.setAttribute("aria-expanded", "true"), this.content.style.position = "absolute", this.cleanup = M(
327
+ this.content.hidden = !1, this.content.style.position = "absolute", this.backdrop.hidden = !1, h(this.content), h(this.backdrop), this.button.setAttribute("aria-expanded", "true"), this.cleanup = M(
328
328
  this.button,
329
329
  this.content,
330
330
  () => {
@@ -419,14 +419,14 @@ const l = class extends HTMLElement {
419
419
  s(this, "onMouseLeave", this.afterDelay.bind(this, this.hide));
420
420
  s(this, "onBlur", this.hide.bind(this));
421
421
  s(this, "onPointerUp", (t) => {
422
- t.pointerType === "mouse" && this.hide();
422
+ t.pointerType === "mouse" ? this.hide() : this.show();
423
423
  });
424
424
  s(this, "onKeyDown", (t) => {
425
425
  t.key === "Escape" && this.hide();
426
426
  });
427
427
  }
428
428
  connectedCallback() {
429
- this.parent = this.parentNode, this.parent && (this.parent.addEventListener("mouseenter", this.onMouseEnter), this.parent.addEventListener("focus", this.onFocus), this.parent.addEventListener("touchstart", this.onFocus), this.parent.addEventListener("mouseleave", this.onMouseLeave), this.parent.addEventListener("blur", this.onBlur), this.parent.addEventListener("pointerup", this.onPointerUp), this.observer = new MutationObserver((t) => {
429
+ this.parent = this.parentNode, this.parent && (this.parent.addEventListener("mouseenter", this.onMouseEnter), this.parent.addEventListener("focus", this.onFocus), this.parent.addEventListener("mouseleave", this.onMouseLeave), this.parent.addEventListener("blur", this.onBlur), this.parent.addEventListener("pointerup", this.onPointerUp), this.observer = new MutationObserver((t) => {
430
430
  t.forEach((e) => {
431
431
  e.attributeName === "disabled" && this.hide();
432
432
  });
@@ -434,7 +434,7 @@ const l = class extends HTMLElement {
434
434
  }
435
435
  disconnectedCallback() {
436
436
  var t;
437
- this.tooltip && (this.tooltip.remove(), this.tooltip = void 0), this.parent && (this.parent.removeEventListener("mouseenter", this.onMouseEnter), this.parent.removeEventListener("focus", this.onFocus), this.parent.removeEventListener("touchstart", this.onFocus), this.parent.removeEventListener("mouseleave", this.onMouseLeave), this.parent.removeEventListener("blur", this.onBlur), this.parent.removeEventListener("pointerup", this.onPointerUp), this.parent = void 0), document.removeEventListener("keydown", this.onKeyDown), document.removeEventListener("scroll", this.onBlur), (t = this.observer) == null || t.disconnect(), clearTimeout(this.timeout);
437
+ this.tooltip && (this.tooltip.remove(), this.tooltip = void 0), this.parent && (this.parent.removeEventListener("mouseenter", this.onMouseEnter), this.parent.removeEventListener("focus", this.onFocus), this.parent.removeEventListener("mouseleave", this.onMouseLeave), this.parent.removeEventListener("blur", this.onBlur), this.parent.removeEventListener("pointerup", this.onPointerUp), this.parent = void 0), document.removeEventListener("keydown", this.onKeyDown), document.removeEventListener("scroll", this.onBlur), (t = this.observer) == null || t.disconnect(), clearTimeout(this.timeout);
438
438
  }
439
439
  get disabled() {
440
440
  return this.hasAttribute("disabled");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inclusive-elements",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Accessible, lightweight, unstyled implementations of common UI controls.",
5
5
  "module": "dist/inclusive-elements.js",
6
6
  "type": "module",