Files
nodeMap/node_modules/@testing-library/user-event/dist/cjs/utils/misc/findClosest.js

15 lines
293 B
JavaScript

'use strict';
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;