Przeglądaj źródła

:bug: 双层抽屉关闭后浏览器滚动条消失

visuddhinanda 3 lat temu
rodzic
commit
855b99a45c

+ 3 - 0
dashboard/src/components/comment/CommentBox.tsx

@@ -26,6 +26,9 @@ const Widget = ({ trigger, resId, resType, onCommentCountChange }: IWidget) => {
 
 
   const onClose = () => {
   const onClose = () => {
     setOpen(false);
     setOpen(false);
+    if (document.getElementsByTagName("body")[0].hasAttribute("style")) {
+      document.getElementsByTagName("body")[0].removeAttribute("style");
+    }
   };
   };
 
 
   const showChildrenDrawer = (
   const showChildrenDrawer = (