don't add helper attr as hack for checkbox and radio (#1970)
This commit is contained in:
@@ -1311,16 +1311,6 @@ async function buildElementObject(
|
|||||||
attrs["required"] = true;
|
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 (elementTagNameLower === "input" || elementTagNameLower === "textarea") {
|
||||||
if (element.type === "password") {
|
if (element.type === "password") {
|
||||||
attrs["value"] = element.value ? "*".repeat(element.value.length) : "";
|
attrs["value"] = element.value ? "*".repeat(element.value.length) : "";
|
||||||
|
|||||||
Reference in New Issue
Block a user