Search.../

onKeyRelease( )

Adds an event handler that runs when the key is released within the dashboard input.

Description

A dashboard input element receives a keyRelease event when a user releases a key on the keyboard while the cursor is inside the input element. A keyRelease event is fired for printable and non-printable characters.

You can also define an event handler using the Properties and Events panel.

Notes:

  • Some browsers do not issue a key release event for certain keys, such as arrow keys or the shift key.

  • When you retrieve the value from the target property of a KeyboardEvent, you get the value of the target element before the key was released.

Syntax

function onKeyRelease(handler: KeyboardEventHandler): Element
handler: function KeyboardEventHandler(event: KeyboardEvent): void

onKeyRelease Parameters

NAME
TYPE
DESCRIPTION
handler

The name of the function or the function expression to run when the element is clicked.

Returns

The element to which the event handler was added.

Return Type:

KeyboardEventHandler Parameters

NAME
TYPE
DESCRIPTION
event

The keyboard event that occurred.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

Print key released and event type

Copy Code
1$w('#myElement').onKeyRelease((event) => {
2 console.log(event.key); // Enter
3 console.log(event.type); // keyRelease
4});