Table of Contents

Class InputEvent

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The InputEvent interface represents an event notifying the user of editable content changes.

[Value("InputEvent")]
public class InputEvent : UIEvent
Inheritance
InputEvent
Inherited Members

Remarks

Constructors

InputEvent()

public InputEvent()

InputEvent(string, InputEventInit)

The InputEvent() constructor creates a new InputEvent object.

public InputEvent(string type, InputEventInit eventInitDict = null)

Parameters

type string
eventInitDict InputEventInit

Remarks

-InputEvent, the interface of the objects it constructs.

See also on MDN

Properties

Data

The data read-only property of the
InputEvent interface returns a string with inserted
characters. This may be an empty string if the change doesn't insert text, such as when
characters are deleted.

[Value("data")]
public string? Data { get; }

Property Value

string

A string or null. The spec has an overview of its value in various cases.

Remarks

DataTransfer

The dataTransfer read-only property of the
InputEvent interface returns a DataTransfer object
containing information about richtext or plaintext data being added to or removed from
editable content.

[Value("dataTransfer")]
public DataTransfer? DataTransfer { get; }

Property Value

DataTransfer

A DataTransfer object or null. The spec has an overview of its value in various cases.

Remarks

InputType

The inputType read-only property of the
InputEvent interface returns the type of change made to editable content.
Possible changes include for example inserting, deleting, and formatting text.

[Value("inputType")]
public string InputType { get; }

Property Value

string

A string containing the type of input that was made. There are many
possible values, such as insertText, deleteContentBackward,
insertFromPaste, and formatBold. For a complete list of the
available input types, see the Attributes section of the Input Events Level 2 spec.

Remarks

IsComposing

The InputEvent.isComposing read-only property returns a
boolean value indicating if the event is fired after
Elementcompositionstart and before Elementcompositionend.

[Value("isComposing")]
public bool IsComposing { get; }

Property Value

bool

A boolean.

Remarks

-Elementcompositionstart and Elementcompositionend
-InputEvent

See also on MDN

Methods

GetTargetRanges()

The getTargetRanges() method of the InputEvent interface returns an array of StaticRange objects that will be affected by a change to the DOM if the input event is not canceled.

[Value("getTargetRanges")]
public List<StaticRange> GetTargetRanges()

Returns

List<StaticRange>

An array of StaticRange objects.

Remarks

This allows web apps to override text edit behavior before the browser modifies the DOM tree, and provides more control over input events to improve performance.

Depending on the value of inputType and the current editing host, the expected return value of this method varies:

See also on MDN