Zum Hauptinhalt springen

Events

Events in KoliBri can be processed as DOM Events or as Callbacks.

DOM Events

The component's events can be handled using event listeners, which may be called with a details parameter:

kolibriElement.addEventListener('kolFocus', (event) => {
/* Do something on focus */
});

kolibriElement.addEventListener('kolInput', (event, { detail: value }) => {
/* Do something with value or event */
});

Callbacks

The component's callbacks can be handled using an _on property, which consists of an object with various callback functions:

kolibriElement._on = {
onFocus: (event) => {
/* Do something on focus */
},
onInput: (event, value) => {
/* Do something with value or event */
}
};