visuddhinanda 3 лет назад
Родитель
Сommit
7f21cf8458
1 измененных файлов с 7 добавлено и 1 удалено
  1. 7 1
      dashboard/src/components/template/SentEdit/SentCell.tsx

+ 7 - 1
dashboard/src/components/template/SentEdit/SentCell.tsx

@@ -60,7 +60,13 @@ const SentCellWidget = ({
   useEffect(() => {
     if (anchorInfo && anchorInfo?.resId === initValue?.id) {
       const ele = document.getElementById(sid);
-      ele?.scrollIntoView();
+      if (ele !== null) {
+        ele.scrollIntoView({
+          behavior: "smooth",
+          block: "center",
+          inline: "nearest",
+        });
+      }
     }
   }, [anchorInfo, initValue?.id, sid]);