# InputElement

Class · extends [`Element`](https://api.playcanvas.com/pcui/classes/Element.md) · implements [`IBindable`](https://api.playcanvas.com/pcui/interfaces/IBindable.md), [`IFocusable`](https://api.playcanvas.com/pcui/interfaces/IFocusable.md), [`IPlaceholder`](https://api.playcanvas.com/pcui/interfaces/IPlaceholder.md)

Source: https://github.com/playcanvas/pcui/blob/77ed2b8ba8660c9644049b0d1942652721e7a6c4/src/components/InputElement/index.ts#L33

The InputElement is an abstract class that manages an input DOM element. It is the superclass of
[TextInput](https://api.playcanvas.com/pcui/classes/TextInput.md) and [NumericInput](https://api.playcanvas.com/pcui/classes/NumericInput.md). It is not intended to be used directly.

## Properties

### blurOnEnter

```ts
blurOnEnter: boolean = true
```

Determines whether the input should blur when the enter key is pressed.

### blurOnEscape

```ts
blurOnEscape: boolean = true
```

Determines whether the input should blur when the escape key is pressed.

## Accessors

### input

```ts
get input(): HTMLInputElement
```

Gets the input DOM element.

### keyChange

```ts
get keyChange(): boolean
set keyChange(value: boolean)
```

Gets the method to call when keyup is called on the input DOM element.

### placeholder

```ts
get placeholder(): string
set placeholder(value: string)
```

Sets the placeholder text of the input.

### renderChanges

```ts
get renderChanges(): boolean
set renderChanges(value: boolean)
```

Sets whether the input should flash on changes.

### value

```ts
abstract get value(): unknown
abstract set value(value: unknown)
```

Sets the value of the Element.

### values

```ts
abstract get values(): unknown[]
abstract set values(value: unknown[])
```

Sets multiple values on the Element. It is up to the Element to determine how to display them.

## Methods

### blur

```ts
blur(): void
```

Unfocuses (blurs) the input element.

### destroy

```ts
destroy(): void
```

Destroys the Element and its events.

### focus

```ts
focus(select?: boolean): void
```

Focuses the input element. If the input contains text and select is `true`, the text will be
selected on focus.

**Parameters**

- `select` (`boolean`, optional): If `true`, the input text will be selected.

## Inherited from [Element](https://api.playcanvas.com/pcui/classes/Element.md)

- `get alignItems(): string` · `set alignItems(value: string)`
- `get alignSelf(): string` · `set alignSelf(value: string)`
- `get binding(): BindingBase` · `set binding(value: BindingBase)`
- `get class(): DOMTokenList`
- `get dom(): HTMLElement`
- `get enabled(): boolean` · `set enabled(value: boolean)`
- `get flexBasis(): string` · `set flexBasis(value: string | number)`
- `get flexDirection(): string` · `set flexDirection(value: string)`
- `get flexGrow(): string` · `set flexGrow(value: string | number)`
- `get flexShrink(): string` · `set flexShrink(value: string | number)`
- `get flexWrap(): string` · `set flexWrap(value: string)`
- `get height(): number` · `set height(value: string | number)`
- `get hidden(): boolean` · `set hidden(value: boolean)`
- `get hiddenToRoot(): boolean`
- `get ignoreParent(): boolean` · `set ignoreParent(value: boolean)`
- `get justifyContent(): string` · `set justifyContent(value: string)`
- `get justifySelf(): string` · `set justifySelf(value: string)`
- `get parent(): Element` · `set parent(value: Element)`
- `get readOnly(): boolean` · `set readOnly(value: boolean)`
- `get style(): CSSStyleDeclaration`
- `get tabIndex(): number` · `set tabIndex(value: number)`
- `get width(): number` · `set width(value: string | number)`
- `flash(): void`
- `link(observers: Observer | Observer[], paths: string | string[]): void`
- `unlink(): void`
- `static create<Type extends Element>(type: string, args: ElementArgs): Type`
- `static register<Type extends Element>(type: string, cls: Object, defaultArguments?: object): void`
- `static unregister(type: string): void`
- `static readonly EVENT_CLICK: "click" = 'click'`
- `static readonly EVENT_DESTROY: "destroy" = 'destroy'`
- `static readonly EVENT_DISABLE: "disable" = 'disable'`
- `static readonly EVENT_ENABLE: "enable" = 'enable'`
- `static readonly EVENT_HIDE: "hide" = 'hide'`
- `static readonly EVENT_HIDE_TO_ROOT: "hideToRoot" = 'hideToRoot'`
- `static readonly EVENT_HOVER: "hover" = 'hover'`
- `static readonly EVENT_HOVER_END: "hoverend" = 'hoverend'`
- `static readonly EVENT_PARENT: "parent" = 'parent'`
- `static readonly EVENT_READ_ONLY: "readOnly" = 'readOnly'`
- `static readonly EVENT_SHOW: "show" = 'show'`
- `static readonly EVENT_SHOW_TO_ROOT: "showToRoot" = 'showToRoot'`

## Inherited from [VectorInput](https://api.playcanvas.com/pcui/classes/VectorInput.md)

- `get error(): boolean` · `set error(value: boolean)`
