UNPKG

@nuxt/ui

Version:

A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.

14 lines (13 loc) 378 B
export function pointerDownOutside(e, options = {}) { const originalEvent = e.detail.originalEvent; const target = originalEvent.target; if (!target?.isConnected) { e.preventDefault(); return; } if (options.scrollable) { if (originalEvent.offsetX > target.clientWidth || originalEvent.offsetY > target.clientHeight) { e.preventDefault(); } } }