fix: capture text selection

This commit is contained in:
amhsirak
2024-12-15 05:07:45 +05:30
parent cb0965323e
commit ddb880df66

View File

@@ -20,7 +20,7 @@ export const getElementInformation = async (
getList: boolean
) => {
try {
if (listSelector !== '') {
if (!getList) {
const elementInfo = await page.evaluate(
async ({ x, y }) => {
const el = document.elementFromPoint(x, y) as HTMLElement;
@@ -158,7 +158,7 @@ export const getElementInformation = async (
*/
export const getRect = async (page: Page, coordinates: Coordinates, listSelector: string, getList: boolean) => {
try {
if (listSelector !== '') {
if (!getList) {
const rect = await page.evaluate(
async ({ x, y }) => {
const el = document.elementFromPoint(x, y) as HTMLElement;