Skip to content

Commit

Permalink
Add workaround for an issue where puppeteer fails to find an element
Browse files Browse the repository at this point in the history
  • Loading branch information
nodaguti committed Jun 13, 2023
1 parent 142cd63 commit 5861c90
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/storycap/src/node/capturing-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,15 @@ export class CapturingBrowser extends StoryPreviewBrowser {

// Clear the browser's mouse state.
if (screenshotOptions.click) {
// Workaround for an issue where puppeteer fails to find a matching element.
// https://github.com/reg-viz/storycap/issues/712
await this.page.evaluate(() => {});
await this.page.$eval(screenshotOptions.click, (e: unknown) => (e as HTMLElement)?.blur());
}
if (screenshotOptions.focus) {
// Workaround for an issue where puppeteer fails to find a matching element.
// https://github.com/reg-viz/storycap/issues/712
await this.page.evaluate(() => {});
await this.page.$eval(screenshotOptions.focus, (e: unknown) => (e as HTMLElement)?.blur());
}
await this.page.mouse.move(0, 0);
Expand Down

0 comments on commit 5861c90

Please sign in to comment.