don't add helper attr as hack for checkbox and radio (#1970)

This commit is contained in:
Shuchang Zheng
2025-03-19 10:33:38 -07:00
committed by GitHub
parent d764f5dd12
commit ab2e5afd72

View File

@@ -1311,16 +1311,6 @@ async function buildElementObject(
attrs["required"] = true;
}
if (
elementTagNameLower === "input" &&
(element.type === "radio" || element.type === "checkbox")
) {
// if checkbox and radio don't have "checked" and "aria-checked", add a checked="false" to help LLM understand
if (!("checked" in attrs) && !("aria-checked" in attrs)) {
attrs["checked"] = false;
}
}
if (elementTagNameLower === "input" || elementTagNameLower === "textarea") {
if (element.type === "password") {
attrs["value"] = element.value ? "*".repeat(element.value.length) : "";