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 thetarget
property of aKeyboardEvent
, you get the value of the target element before the key was released.
Syntax
function onKeyRelease(handler: KeyboardEventHandler): Elementhandler: function KeyboardEventHandler(event: KeyboardEvent): void
onKeyRelease Parameters
NAME
TYPE
DESCRIPTION
The name of the function or the function expression to run when the element is clicked.
KeyboardEventHandler Parameters
NAME
TYPE
DESCRIPTION
Returns
This function does not return anything.
Return Type:
Was this helpful?
Print key released and event type
1$w('#myElement').onKeyRelease((event) => {2 console.log(event.key); // Enter3 console.log(event.type); // keyRelease4});