mirror of https://github.com/status-im/consul.git
16 lines
321 B
JavaScript
16 lines
321 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
export default function (sel, el) {
|
|
// basic DOM closest utility to cope with no support
|
|
// TODO: instead of degrading gracefully
|
|
// add a while polyfill for closest
|
|
try {
|
|
return el.closest(sel);
|
|
} catch (e) {
|
|
return;
|
|
}
|
|
}
|