Просмотр исходного кода

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

visuddhinanda 3 лет назад
Родитель
Сommit
855b99a45c
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      dashboard/src/components/comment/CommentBox.tsx

+ 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 = (