From f69acdaadc379f0ac9458c0165fe3eb23958baa6 Mon Sep 17 00:00:00 2001 From: LawyZheng Date: Wed, 15 Oct 2025 14:39:27 +0800 Subject: [PATCH] readonly input type dropdown (#3717) --- skyvern/webeye/scraper/domUtils.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/skyvern/webeye/scraper/domUtils.js b/skyvern/webeye/scraper/domUtils.js index f6631086..f778c939 100644 --- a/skyvern/webeye/scraper/domUtils.js +++ b/skyvern/webeye/scraper/domUtils.js @@ -790,9 +790,12 @@ function isInteractableInput(element, hoverStylesMap) { // "city", "state", "zip", "country" // That's the reason I (Kerem) removed the valid input types check var type = element.getAttribute("type")?.toLowerCase().trim() ?? "text"; + var readOnly = isReadonlyElement(element); + return ( isHoverPointerElement(element, hoverStylesMap) || - (!isReadonlyElement(element) && type !== "hidden") + isReadonlyInputDropdown(element) || + (!readOnly && type !== "hidden") ); } @@ -916,7 +919,9 @@ function isInteractable(element, hoverStylesMap) { if ( tagName === "li" && - (className.includes("ui-menu-item") || className.includes("dropdown-item")) + (className.includes("ui-menu-item") || + className.includes("dropdown-item") || + className === "option") ) { return true; } @@ -1106,6 +1111,15 @@ const isReactSelectDropdown = (element) => { ); }; +function isReadonlyInputDropdown(element) { + const className = element.className?.toString() ?? ""; + return ( + element.tagName.toLowerCase() === "input" && + className.includes("custom-select") && + isReadonlyElement(element) + ); +} + function hasNgAttribute(element) { if (!element.attributes[Symbol.iterator]) { return false; @@ -1490,7 +1504,8 @@ async function buildElementObject( isAngularDropdown(element) || isAngularMaterialDatePicker(element) || isSelect2Dropdown(element) || - isSelect2MultiChoice(element), + isSelect2MultiChoice(element) || + isReadonlyInputDropdown(element), }; let isInShadowRoot = element.getRootNode() instanceof ShadowRoot;