add svg into interactable detecting (#1917)

This commit is contained in:
Shuchang Zheng
2025-03-10 12:04:45 -07:00
committed by GitHub
parent aa83da1cba
commit 785c2f0626
3 changed files with 11 additions and 5 deletions

View File

@@ -94,12 +94,17 @@ def json_to_html(element: dict, need_skyvern_attrs: bool = True) -> str:
"""
if element is flagged as dropped, the html format is empty
"""
if element.get("isDropped", False):
return ""
tag = element["tagName"]
attributes: dict[str, Any] = copy.deepcopy(element.get("attributes", {}))
interactable = element.get("interactable", False)
if element.get("isDropped", False):
if not interactable:
return ""
else:
LOG.info("Element is interactable. Trimmed all attributes instead of dropping it", element=element)
attributes = {}
if element.get("isCheckable", False) and tag != "input":
tag = "input"
attributes["type"] = "checkbox"