revert checkbox detect enhance (#1998)
This commit is contained in:
@@ -811,21 +811,6 @@ function isDatePickerSelector(element) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isCheckableDiv(element) {
|
|
||||||
const tagName = element.tagName.toLowerCase();
|
|
||||||
if (tagName !== "div") {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
element.className &&
|
|
||||||
element.className.toString().includes("checkbox") &&
|
|
||||||
element.childElementCount === 0
|
|
||||||
) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const isComboboxDropdown = (element) => {
|
const isComboboxDropdown = (element) => {
|
||||||
if (element.tagName.toLowerCase() !== "input") {
|
if (element.tagName.toLowerCase() !== "input") {
|
||||||
return false;
|
return false;
|
||||||
@@ -1345,7 +1330,6 @@ async function buildElementObject(
|
|||||||
isAngularMaterialDatePicker(element) ||
|
isAngularMaterialDatePicker(element) ||
|
||||||
isSelect2Dropdown(element) ||
|
isSelect2Dropdown(element) ||
|
||||||
isSelect2MultiChoice(element),
|
isSelect2MultiChoice(element),
|
||||||
isCheckable: isCheckableDiv(element),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let isInShadowRoot = element.getRootNode() instanceof ShadowRoot;
|
let isInShadowRoot = element.getRootNode() instanceof ShadowRoot;
|
||||||
|
|||||||
@@ -105,10 +105,6 @@ def json_to_html(element: dict, need_skyvern_attrs: bool = True) -> str:
|
|||||||
LOG.info("Element is interactable. Trimmed all attributes instead of dropping it", element=element)
|
LOG.info("Element is interactable. Trimmed all attributes instead of dropping it", element=element)
|
||||||
attributes = {}
|
attributes = {}
|
||||||
|
|
||||||
if element.get("isCheckable", False) and tag != "input":
|
|
||||||
tag = "input"
|
|
||||||
attributes["type"] = "checkbox"
|
|
||||||
|
|
||||||
context = skyvern_context.ensure_context()
|
context = skyvern_context.ensure_context()
|
||||||
|
|
||||||
# FIXME: Theoretically, all href links with over 69(64+1+4) length could be hashed
|
# FIXME: Theoretically, all href links with over 69(64+1+4) length could be hashed
|
||||||
|
|||||||
Reference in New Issue
Block a user