From 3e3ab584b3c2365b3235c9dd647cd8f043cc306d Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 7 Sep 2024 22:02:06 +0530 Subject: [PATCH] feat: create data var for getList --- src/components/organisms/BrowserWindow.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/organisms/BrowserWindow.tsx b/src/components/organisms/BrowserWindow.tsx index 90d19a10..33deca13 100644 --- a/src/components/organisms/BrowserWindow.tsx +++ b/src/components/organisms/BrowserWindow.tsx @@ -206,7 +206,9 @@ export const BrowserWindow = () => { // Add fields to the list if (options.length === 1) { const attribute = options[0].value; - const newField: TextStep = { + const data = attribute === 'href' ? highlighterData.elementInfo?.url || '' : + attribute === 'src' ? highlighterData.elementInfo?.imageUrl || '' : + highlighterData.elementInfo?.innerText || ''; const newField: TextStep = { id: Date.now(), type: 'text', label: `Label ${Object.keys(fields).length + 1}`,