MCPcopy Create free account
hub / github.com/UI5/webcomponents / isElementClickable

Function isElementClickable

packages/base/src/util/isElementClickable.ts:4–17  ·  view source on GitHub ↗
(el: HTMLElement)

Source from the content-addressed store, hash-verified

2const rFocusable = /^(?:input|select|textarea|button)$/i;
3
4const isElementClickable = (el: HTMLElement): boolean => {
5 if ((el as HTMLButtonElement).disabled) {
6 return false;
7 }
8
9 const tabIndex = el.getAttribute("tabindex");
10 if (tabIndex !== null && tabIndex !== undefined) {
11 return parseInt(tabIndex) >= 0;
12 }
13
14 return rFocusable.test(el.nodeName)
15 || (rClickable.test(el.nodeName)
16 && !!(el as HTMLLinkElement).href);
17};
18
19export default isElementClickable;

Callers 2

groupElementToFocusMethod · 0.85
findFocusableElementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…