quick fix for hidden pointer input button? (#904)

This commit is contained in:
Kerem Yilmaz
2024-10-03 23:40:05 -07:00
committed by GitHub
parent b0aa181c68
commit b034a2f56c

View File

@@ -264,7 +264,22 @@ function isElementVisible(element) {
function isHidden(element) {
const style = getElementComputedStyle(element);
return style?.display === "none" || element.hidden;
if (style?.display === "none") {
return true;
}
if (element.hidden) {
if (
style?.cursor === "pointer" &&
element.tagName.toLowerCase() === "input" &&
(element.type === "submit" || element.type === "button")
) {
// there are cases where the input is a "submit" button and the cursor is a pointer but the element has the hidden attr.
// such an element is not really hidden
return false;
}
return true;
}
return false;
}
function isHiddenOrDisabled(element) {