Hello and thank you for the form viewer library.
I am trying to add simple event listeners for each field of my form.
I found that’s not that easy or I am missing something. For example I need to add an onBlur event for the textfield but it does not work.
Blockquote
components: [
{
label: ‘URI’,
type: ‘textfield’,
id: ‘field_id’,
key: ‘uri’,
defaultValue: ‘http://’,
onBlur: () => {
console.log(‘field is blurred’)
}
},
am I missing sothing?
Am I correct you want to provide custom event listeners for form fields? This is not possible at the moment, unfortunately.
The solution you sketched via form schema will also be hard to support, as forms are JSON objects that won’t be able to store Javascript functions. I think the best solution would be to use the eventBus to listen for such events.