yohei0125 4 years ago
parent
commit
ff7acb525d
1 changed files with 4 additions and 3 deletions
  1. 4 3
      packages/app/src/components/SearchPage/SearchResultContent.tsx

+ 4 - 3
packages/app/src/components/SearchPage/SearchResultContent.tsx

@@ -62,9 +62,10 @@ const scrollTo = (scrollElement:HTMLElement) => {
 };
 
 const MutationObserverWrapper = (scrollElement:HTMLElement) => {
-  const observerCallback = (mutationRecords) => {
-    mutationRecords.forEach((record) => {
-      const targetId = record.target.id;
+  const observerCallback = (mutationRecords:MutationRecord[]) => {
+    mutationRecords.forEach((record:MutationRecord) => {
+      const target = record.target as HTMLElement;
+      const targetId = target.id as string;
       if (targetId !== 'wiki') return;
       scrollTo(scrollElement);
     });