feat: create data var for getList

This commit is contained in:
karishmas6
2024-09-07 22:02:06 +05:30
parent 9eb6f77e94
commit 3e3ab584b3

View File

@@ -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}`,