Skip to content

Commit 1ab4631

Browse files
committed
feat: handle select tags in getElementInfo
1 parent 50ca6cc commit 1ab4631

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

server/src/workflow-management/selector.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,13 @@ export const getElementInformation = async (
175175
info.innerText = targetElement.textContent ?? '';
176176
} else if (targetElement.tagName === 'IMG') {
177177
info.imageUrl = (targetElement as HTMLImageElement).src;
178+
} else if (targetElement?.tagName === 'SELECT') {
179+
const selectElement = targetElement as HTMLSelectElement;
180+
info.innerText = selectElement.options[selectElement.selectedIndex]?.text ?? '';
181+
info.attributes = {
182+
...info.attributes,
183+
selectedValue: selectElement.value,
184+
};
178185
} else {
179186
info.hasOnlyText = targetElement.children.length === 0 &&
180187
(targetElement.textContent !== null &&

0 commit comments

Comments
 (0)