@idds/js 1.0.64 → 1.0.65

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.
Files changed (2) hide show
  1. package/dist/index.js +16 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -918,9 +918,10 @@ var handleDropdownLogic = (rootSelector, triggerSelector, panelSelector, activeC
918
918
  const shouldExpand = force !== void 0 ? force : !isExpanded;
919
919
  trigger.setAttribute("aria-expanded", shouldExpand);
920
920
  if (shouldExpand) {
921
- panel.classList.add(activeClass);
922
- panel.style.display = "block";
923
- if (activeClass) panel.classList.add(activeClass);
921
+ if (activeClass) {
922
+ panel.classList.add(activeClass);
923
+ }
924
+ panel.style.removeProperty("display");
924
925
  if (rootSelector.includes("basic")) {
925
926
  const btn = trigger.querySelector(
926
927
  `.${PREFIX3}-basic-dropdown__trigger-button`
@@ -931,8 +932,11 @@ var handleDropdownLogic = (rootSelector, triggerSelector, panelSelector, activeC
931
932
  trigger.classList.add(`${PREFIX3}-action-dropdown__trigger--open`);
932
933
  }
933
934
  } else {
934
- if (activeClass) panel.classList.remove(activeClass);
935
- panel.style.display = "none";
935
+ if (activeClass) {
936
+ panel.classList.remove(activeClass);
937
+ } else {
938
+ panel.style.display = "none";
939
+ }
936
940
  if (rootSelector.includes("basic")) {
937
941
  const btn = trigger.querySelector(
938
942
  `.${PREFIX3}-basic-dropdown__trigger-button`
@@ -946,7 +950,12 @@ var handleDropdownLogic = (rootSelector, triggerSelector, panelSelector, activeC
946
950
  }
947
951
  }
948
952
  };
949
- panel.style.display = "none";
953
+ if (!activeClass) {
954
+ panel.style.display = "none";
955
+ } else {
956
+ panel.classList.remove(activeClass);
957
+ panel.style.removeProperty("display");
958
+ }
950
959
  trigger.addEventListener("click", (e) => {
951
960
  e.stopPropagation();
952
961
  toggle();
@@ -1027,7 +1036,7 @@ function initSelectDropdown(rootSelector = `.${PREFIX4}-select-dropdown`) {
1027
1036
  isOpen = shouldOpen;
1028
1037
  trigger.setAttribute("aria-expanded", isOpen);
1029
1038
  if (isOpen) {
1030
- panel.style.display = "block";
1039
+ panel.style.removeProperty("display");
1031
1040
  if (input) input.focus();
1032
1041
  } else {
1033
1042
  panel.style.display = "none";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idds/js",
3
- "version": "1.0.64",
3
+ "version": "1.0.65",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },