feat: check if parent el's tag name is a + use parent elt if true, otherwise uses the original element

This commit is contained in:
karishmas6
2024-06-05 06:28:49 +05:30
parent 074cc697b2
commit 59f778a0c6

View File

@@ -20,6 +20,8 @@ export const getRect = async (page: Page, coordinates: Coordinates) => {
const el = document.elementFromPoint(x, y) as HTMLElement; const el = document.elementFromPoint(x, y) as HTMLElement;
if (el) { if (el) {
const { parentElement } = el; const { parentElement } = el;
// Match the logic in recorder.ts for link clicks
const element = parentElement?.tagName === 'A' ? parentElement : el;
}}, }},