CustomEvent

open class CustomEvent<out D : JsAny?>(val type: EventType<CustomEvent<D>>, init: CustomEventInit<D> = definedExternally) : Event(source)

The CustomEvent interface represents events initialized by an application for any purpose.

MDN Reference

Constructors

Link copied to clipboard
constructor(type: EventType<CustomEvent<D>>, init: CustomEventInit<D> = definedExternally)

Properties

Link copied to clipboard
Link copied to clipboard

The bubbles read-only property of the Event interface indicates whether the event bubbles up through the DOM tree or not.

Link copied to clipboard
Link copied to clipboard

The cancelable read-only property of the Event interface indicates whether the event can be canceled, and therefore prevented as if the event never happened.

Link copied to clipboard
Link copied to clipboard

The read-only composed property of the or not the event will propagate across the shadow DOM boundary into the standard DOM.

Link copied to clipboard

The currentTarget read-only property of the Event interface identifies the element to which the event handler has been attached.

Link copied to clipboard

The defaultPrevented read-only property of the Event interface returns a boolean value indicating whether or not the call to Event.preventDefault() canceled the event.

Link copied to clipboard
val detail: D

The read-only detail property of the CustomEvent interface returns any data passed when initializing the event.

Link copied to clipboard

The eventPhase read-only property of the being evaluated.

Link copied to clipboard

The isTrusted read-only property of the when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and false when the event was dispatched via The only exception is the click event, which initializes the isTrusted property to false in user agents.

Link copied to clipboard
Link copied to clipboard

The read-only target property of the dispatched.

Link copied to clipboard

The timeStamp read-only property of the Event interface returns the time (in milliseconds) at which the event was created.

Link copied to clipboard
open override val type: EventType<CustomEvent<D>>

Functions

Link copied to clipboard
open override fun asInit(): CustomEventInit<D>
Link copied to clipboard

The composedPath() method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked.

Link copied to clipboard

The preventDefault() method of the Event interface tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be.

Link copied to clipboard

The stopImmediatePropagation() method of the If several listeners are attached to the same element for the same event type, they are called in the order in which they were added.

Link copied to clipboard

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.