From 8577bd71a15bdb2585805ecb65424828d036dab7 Mon Sep 17 00:00:00 2001 From: LawyZheng Date: Thu, 11 Apr 2024 23:48:33 +0800 Subject: [PATCH] don't hide select2 element if not neccessary --- skyvern/webeye/scraper/domUtils.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/skyvern/webeye/scraper/domUtils.js b/skyvern/webeye/scraper/domUtils.js index 4a08cec8d..166c9d84a 100644 --- a/skyvern/webeye/scraper/domUtils.js +++ b/skyvern/webeye/scraper/domUtils.js @@ -504,9 +504,6 @@ function buildTreeFromBody() { const selectContainers = document.querySelectorAll(".select2-container"); selectContainers.forEach((element) => { - // hide the select2 container - element.style.display = "none"; - // search select in previous let _pre = element.previousElementSibling; while (_pre) { @@ -515,6 +512,8 @@ function buildTreeFromBody() { _pre.style.display === "none" ) { _pre.style.removeProperty("display"); + // only hide the select2 container when an alternative select found + element.style.display = "none"; return; } _pre = _pre.previousElementSibling; @@ -528,6 +527,8 @@ function buildTreeFromBody() { _next.style.display === "none" ) { _next.style.removeProperty("display"); + // only hide the select2 container when an alternative select found + element.style.display = "none"; return; } _next = _next.nextElementSibling;