wilday_ui 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02c0fb2e9d7f76dd88e920fa1f552022a53e09cf41f5934a184c750752bcc1f1
4
- data.tar.gz: be810e3532a63743bbc6c44def8d285d7359f2b43d3e818a08b26f29f4c12c8a
3
+ metadata.gz: d2e04d403a797e815f3db93143464606d159b1335c9d0d24b2dd9c5d3d16e28f
4
+ data.tar.gz: d6b88c2bd7353202331f9e9442abc43472e74dade6a0d97605ad3ca3042bf17e
5
5
  SHA512:
6
- metadata.gz: 6dc1bb71dfbb0626d11f5fb25de9d8fecd3f213953c3016a960d7bd7da8fd0705b9906e181b0d282efdfc7679bc04d1eabe7bd08f9fb9c79756df0f0919d0723
7
- data.tar.gz: 2664658acf19f2ca4e1ec55f982b3f49b27117c780b663de19d7de94a073e4c6e847f09e0fc0b741d7ab3fc6ec1912d34560a0d7f70ce20e9b83c921a7630f5f
6
+ metadata.gz: 3828bf06a18e492ff4bc765ec0fbaad5afbec6558770c8708a1e6606c7ead1f56b5d3f41704a70704a7a2af4a00d43edbe1f8d9b2260fdbdd128a0b1ddae800c
7
+ data.tar.gz: 2982c22352e77f0c9ff7f2cc7b82e570edc6d153aff6ab01fc7e4b71039fa3e8bbd37e1703232115e9a350116106ac58da4455825a609cb415dec45d4d1bd49f
@@ -2504,6 +2504,7 @@ var dropdown_controller_default = class extends Controller {
2504
2504
  const align = this.element.dataset.dropdownAlignValue;
2505
2505
  if (position) this.positionValue = position;
2506
2506
  if (align) this.alignValue = align;
2507
+ this.updatePosition();
2507
2508
  if (this.triggerValue === "hover") {
2508
2509
  this.element.addEventListener("mouseenter", () => {
2509
2510
  console.log("Mouse enter - showing menu");
@@ -2523,6 +2524,7 @@ var dropdown_controller_default = class extends Controller {
2523
2524
  }
2524
2525
  handleHover(show) {
2525
2526
  if (show) {
2527
+ this.updatePosition();
2526
2528
  this.menuTarget.classList.add("show");
2527
2529
  this.buttonTarget.classList.add("active");
2528
2530
  this.buttonTarget.setAttribute("aria-expanded", "true");
@@ -2537,8 +2539,13 @@ var dropdown_controller_default = class extends Controller {
2537
2539
  event.stopPropagation();
2538
2540
  if (this.isOpen) {
2539
2541
  this.menuTarget.classList.remove("show");
2542
+ this.buttonTarget.classList.remove("active");
2543
+ this.buttonTarget.setAttribute("aria-expanded", "false");
2540
2544
  } else {
2545
+ this.updatePosition();
2541
2546
  this.menuTarget.classList.add("show");
2547
+ this.buttonTarget.classList.add("active");
2548
+ this.buttonTarget.setAttribute("aria-expanded", "true");
2542
2549
  }
2543
2550
  }
2544
2551
  show() {
@@ -2693,7 +2700,7 @@ var dropdown_controller_default = class extends Controller {
2693
2700
  );
2694
2701
  }
2695
2702
  updatePosition() {
2696
- const menuElement = this.element.querySelector(".w-button-dropdown-menu");
2703
+ const menuElement = this.menuTarget;
2697
2704
  const position = this.hasPositionValue ? this.positionValue : "bottom";
2698
2705
  const align = this.hasAlignValue ? this.alignValue : "start";
2699
2706
  menuElement.setAttribute("data-position", position);