@testing-library/user-event
Version:
Fire events the same way the user does
17 lines (13 loc) • 357 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
function findClosest(element, callback) {
let el = element;
do {
if (callback(el)) {
return el;
}
el = el.parentElement;
}while (el && el !== element.ownerDocument.body)
return undefined;
}
exports.findClosest = findClosest;