Browse Source

fix: scroll element to screenshot into center

Ahmad Kholid 2 years ago
parent
commit
65c1ee4ce4
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/content/blocksHandler/handlerTakeScreenshot.js

+ 4 - 1
src/content/blocksHandler/handlerTakeScreenshot.js

@@ -71,7 +71,10 @@ async function captureElement({ selector, tabId, options }) {
     throw error;
   }
 
-  element.scrollIntoView();
+  element.scrollIntoView({
+    block: 'center',
+    inline: 'center',
+  });
 
   await sleep(500);