1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +02:00
joplin/packages/utils/dom.ts

10 lines
281 B
TypeScript

/* eslint-disable import/prefer-default-export */
export const findParentElementByClassName = (element: any, parentClassName: string) => {
while (element) {
if (element.classList.contains(parentClassName)) return element;
element = element.parentElement;
}
return null;
};