All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.util.isElementClickable.js Maven / Gradle / Ivy

const rClickable = /^(?:a|area)$/i;
const rFocusable = /^(?:input|select|textarea|button)$/i;
const isElementClickable = (el) => {
    if (el.disabled) {
        return false;
    }
    const tabIndex = el.getAttribute("tabindex");
    if (tabIndex !== null && tabIndex !== undefined) {
        return parseInt(tabIndex) >= 0;
    }
    return rFocusable.test(el.nodeName)
        || (rClickable.test(el.nodeName)
            && !!el.href);
};
export default isElementClickable;
//# sourceMappingURL=isElementClickable.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy