# ElementInputEvent

Class · category: User Interface

Source: https://github.com/playcanvas/engine/blob/f059dc005842f76e052cdf44d8370c8c7ec475ac/src/framework/input/element-input.js#L124

Represents an input event fired on a [ElementComponent](https://api.playcanvas.com/engine/classes/ElementComponent.md). When an event is raised on an
ElementComponent it bubbles up to its parent ElementComponents unless we call stopPropagation().

## Constructors

### constructor

```ts
new ElementInputEvent(event: MouseEvent | TouchEvent | XRInputSourceEvent | null, element: ElementComponent, camera: CameraComponent)
```

Create a new ElementInputEvent instance.

**Parameters**

- `event` (`MouseEvent | TouchEvent | XRInputSourceEvent | null`): The
  browser event that was originally raised, or null if there was none.
- `element` ([`ElementComponent`](https://api.playcanvas.com/engine/classes/ElementComponent.md)): The ElementComponent that this event was originally
  raised on.
- `camera` ([`CameraComponent`](https://api.playcanvas.com/engine/classes/CameraComponent.md)): The CameraComponent that this event was originally raised
  via.

## Properties

### camera

```ts
camera: CameraComponent
```

The CameraComponent that this event was originally raised via.

### element

```ts
element: ElementComponent
```

The ElementComponent that this event was originally raised on.

### event

```ts
event: MouseEvent | TouchEvent | XRInputSourceEvent | null
```

The browser event that was originally raised: a MouseEvent, TouchEvent or
XRInputSourceEvent. It is null when no browser event caused this one, as for
`selectmove`.

## Methods

### stopPropagation

```ts
stopPropagation(): void
```

Stop propagation of the event to parent [ElementComponent](https://api.playcanvas.com/engine/classes/ElementComponent.md)s. This also stops
propagation of the event to other event listeners of the original DOM Event.
