MCPcopy Create free account
hub / github.com/InverseUI/InverseUI-Recorder / isElementInteractive

Function isElementInteractive

util/dom_utils.js:101–113  ·  view source on GitHub ↗
(element)

Source from the content-addressed store, hash-verified

99 * Check if element is interactive (clickable, editable, etc.)
100 */
101export 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected