feat: check if element found @ coordinates

This commit is contained in:
karishmas6
2024-06-05 06:27:17 +05:30
parent 7d3bd22cd4
commit 074cc697b2

View File

@@ -18,6 +18,11 @@ export const getRect = async (page: Page, coordinates: Coordinates) => {
const rect = await page.evaluate(
async ({ x, y }) => {
const el = document.elementFromPoint(x, y) as HTMLElement;
if (el) {
const { parentElement } = el;
}},
);
} catch (error) {