not try selectable input for otp or secret input (#3843)

This commit is contained in:
LawyZheng
2025-10-29 12:26:23 +08:00
committed by GitHub
parent 12e83cdf9a
commit 31eca44f8e
2 changed files with 8 additions and 0 deletions

View File

@@ -1105,6 +1105,8 @@ async def handle_input_text_action(
# check if it's selectable
if (
not input_or_select_context.is_search_bar # no need to to trigger selection logic for search bar
and not is_totp_value
and not is_secret_value
and skyvern_element.get_tag_name() == InteractiveElement.INPUT
and not await skyvern_element.is_raw_input()
):

View File

@@ -209,6 +209,12 @@ class SkyvernElement:
if await self.get_attr("min") or await self.get_attr("max") or await self.get_attr("step"):
return True
# maxlength=6 or maxlength=1 usually means it's an OTP input field
# already consider type="tel" or type="number" as raw_input in the previous logic, so need to confirm it for the OTP field
max_length = str(await self.get_attr("maxlength", mode="static"))
if input_type.lower() == "text" and max_length in ["1", "6"]:
return True
return False
async def is_spinbtn_input(self) -> bool: