extend auto completion to support google address (#1174)
This commit is contained in:
@@ -476,6 +476,24 @@ function isInteractable(element) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
tagName === "li" &&
|
||||||
|
element.className.toString().includes("ui-menu-item")
|
||||||
|
) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// google map address auto complete
|
||||||
|
// https://developers.google.com/maps/documentation/javascript/place-autocomplete#style-autocomplete
|
||||||
|
// demo: https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform
|
||||||
|
if (
|
||||||
|
tagName === "div" &&
|
||||||
|
element.className.toString().includes("pac-item") &&
|
||||||
|
element.closest('div[class*="pac-container"]')
|
||||||
|
) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
tagName === "div" &&
|
tagName === "div" &&
|
||||||
element.hasAttribute("aria-disabled") &&
|
element.hasAttribute("aria-disabled") &&
|
||||||
@@ -484,7 +502,7 @@ function isInteractable(element) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tagName === "span" && element.closest("div[id^='dropdown-container']")) {
|
if (tagName === "span" && element.closest('div[id*="dropdown-container"]')) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -143,6 +143,10 @@ class SkyvernElement:
|
|||||||
if autocomplete and autocomplete == "list":
|
if autocomplete and autocomplete == "list":
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
class_name: str = await self.get_attr("class")
|
||||||
|
if "autocomplete-input" in class_name:
|
||||||
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
async def is_custom_option(self) -> bool:
|
async def is_custom_option(self) -> bool:
|
||||||
|
|||||||
Reference in New Issue
Block a user