@hello-pangea/dnd
Version:
Beautiful and accessible drag and drop for lists with React
12 lines (10 loc) • 399 B
text/typescript
import getWindowFromEl from '../window/get-window-from-el';
export default function isSvgElement(el: any): boolean {
// Some environments do not support SVGElement
// Doing a double lookup rather than storing the window
// as a %checks function can only be a 'simple predicate'
return (
Boolean(getWindowFromEl(el).SVGElement) &&
el instanceof getWindowFromEl(el).SVGElement
);
}