(element)
| 99 | * Check if element is interactive (clickable, editable, etc.) |
| 100 | */ |
| 101 | export function isElementInteractive(element) { |
| 102 | if (!element) return false; |
| 103 | |
| 104 | const tagName = element.tagName.toLowerCase(); |
| 105 | const interactiveTags = ['button', 'a', 'input', 'select', 'textarea']; |
| 106 | |
| 107 | return interactiveTags.includes(tagName) || |
| 108 | element.onclick !== null || |
| 109 | element.getAttribute('onclick') !== null || |
| 110 | element.hasAttribute('role') || |
| 111 | element.tabIndex >= 0 || |
| 112 | element.isContentEditable; |
| 113 | } |
| 114 | |
| 115 | /** |
| 116 | * Get element's position relative to viewport |
nothing calls this directly
no outgoing calls
no test coverage detected