use value of the optiona when the content is empty (#4035)
This commit is contained in:
@@ -1380,6 +1380,7 @@ function getSelectOptions(element) {
|
||||
selectOptions.push({
|
||||
optionIndex: option.index,
|
||||
text: removeMultipleSpaces(option.textContent),
|
||||
value: removeMultipleSpaces(option.value),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -152,6 +152,8 @@ def json_to_html(element: dict, need_skyvern_attrs: bool = True) -> str:
|
||||
# build option HTML
|
||||
option_html = "".join(
|
||||
f'<option index="{option.get("optionIndex")}">{option.get("text")}</option>'
|
||||
if option.get("text")
|
||||
else f'<option index="{option.get("optionIndex")}" value="{option.get("value")}">{option.get("text")}</option>'
|
||||
for option in element.get("options", [])
|
||||
)
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@ RAW_INPUT_NAME_VALUE = ["name", "email", "username", "password", "phone"]
|
||||
class SkyvernOptionType(typing.TypedDict):
|
||||
optionIndex: int
|
||||
text: str
|
||||
value: str
|
||||
|
||||
|
||||
class SkyvernElement:
|
||||
|
||||
Reference in New Issue
Block a user