MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / isInteractive

Function isInteractive

lib/html.js:102–112  ·  view source on GitHub ↗
(element)

Source from the content-addressed store, hash-verified

100
101 // Function to check if an element is interactive
102 function isInteractive(element) {
103 if (element.nodeName === 'input' && element.attrs.find(attr => attr.name === 'type' && attr.value === 'hidden')) return false
104 if (interactiveElements.includes(element.nodeName)) return true
105 if (element.attrs) {
106 if (element.attrs.find(attr => attr.name === 'contenteditable')) return true
107 if (element.attrs.find(attr => attr.name === 'tabindex')) return true
108 const role = element.attrs.find(attr => attr.name === 'role')
109 if (role && allowedRoles.includes(role.value)) return true
110 }
111 return false
112 }
113
114 function hasMeaningfulText(node) {
115 if (textElements.includes(node.nodeName)) return true

Callers 2

hasInteractiveDescendantFunction · 0.85
removeNonInteractiveFunction · 0.85

Calls 2

includesMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected