@idds/js 1.0.80 → 1.0.81

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 +6 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -962,18 +962,24 @@ function initDrawer(rootSelector = `.${PREFIX2}-drawer`) {
962
962
  const closeDrawer = (drawer) => {
963
963
  if (!drawer) return;
964
964
  drawer.classList.add(`${PREFIX2}-drawer--closing`);
965
+ drawer.classList.remove(`${PREFIX2}-drawer--open`);
965
966
  const onAnimationEnd = () => {
966
967
  drawer.classList.remove(`${PREFIX2}-drawer--closing`);
967
968
  drawer.style.display = "none";
968
969
  document.body.style.overflow = "";
969
970
  drawer.removeEventListener("animationend", onAnimationEnd);
970
971
  };
972
+ setTimeout(() => {
973
+ if (drawer.style.display !== "none") onAnimationEnd();
974
+ }, 300);
971
975
  drawer.addEventListener("animationend", onAnimationEnd, { once: true });
972
976
  };
973
977
  const openDrawer = (drawer) => {
974
978
  if (!drawer) return;
975
979
  drawer.style.display = "flex";
976
980
  document.body.style.overflow = "hidden";
981
+ drawer.offsetHeight;
982
+ drawer.classList.add(`${PREFIX2}-drawer--open`);
977
983
  drawer.dispatchEvent(new CustomEvent("drawer:open"));
978
984
  };
979
985
  drawers.forEach((drawer) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idds/js",
3
- "version": "1.0.80",
3
+ "version": "1.0.81",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },