File "prevent.ts"

Full path: /home/fsibplc/public_html/sommilito-bank2/splide-4.1.3/src/js/utils/dom/prevent/prevent.ts
File size: 380 B (380 B bytes)
MIME-type: text/plain
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

/**
 * Call the `preventDefault()` of the provided event.
 *
 * @param e               - An Event object.
 * @param stopPropagation - Optional. Whether to stop the event propagation or not.
 */
export function prevent( e: Event, stopPropagation?: boolean ): void {
  e.preventDefault();

  if ( stopPropagation ) {
    e.stopPropagation();
    e.stopImmediatePropagation();
  }
}