From 864d4e1ad2c49bb12e6999968894ac114f29fb7a Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Tue, 6 Aug 2024 02:16:53 +0530 Subject: [PATCH] fix: add browser step iff getText true --- src/components/organisms/BrowserWindow.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/organisms/BrowserWindow.tsx b/src/components/organisms/BrowserWindow.tsx index 8359ba91..a0d58906 100644 --- a/src/components/organisms/BrowserWindow.tsx +++ b/src/components/organisms/BrowserWindow.tsx @@ -111,6 +111,7 @@ export const BrowserWindow = () => { clickY >= highlightRect.top && clickY <= highlightRect.bottom ) { + if (getText === true) { const options = getAttributeOptions(highlighterData.elementInfo?.tagName || ''); if (options.length > 1) { setAttributeOptions(options); @@ -127,6 +128,7 @@ export const BrowserWindow = () => { }); } } + } } }; @@ -144,11 +146,15 @@ export const BrowserWindow = () => { data = selectedElement.info?.innerText || ''; } - addBrowserStep('', data, { - selector: selectedElement.selector, - tag: selectedElement.info?.tagName, - attribute: attribute - }); + { + if (getText === true) { + addBrowserStep('', data, { + selector: selectedElement.selector, + tag: selectedElement.info?.tagName, + attribute: attribute + }); + } + } } setShowAttributeModal(false); };