UNPKG

@testing-library/user-event

Version:
15 lines (12 loc) 293 B
'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;