Hello,
Instead I'm looking to fire an event only when the focusout event occurs (i.e user moves out of the input field).
At the moment, I'm approaching this by creating a custom field input class and extending the existing blockly field input class. I've overriding the following functions:
1. setValue: 2 changes here:
- Accept a flag to prevent events being fired. This flag will be passed by onHtmlInputChange (see below).
- Check the 'newValue' against the original oldValue (i.e the value before the user focused into the input field.
2. onHtmlInputChange: pass a flag to setValue function to do everything it normally does except fire out an event.
3. bindInputEvents_: I added focus in and focus out event handlers.
4. unbindInputEvents_: to unbind the focus in event.
5. dispose: to unbind the focus out event.
Moreover, because I have a multiline input field, I've had to do the same as above.
I'm wondering if there is a better/cleaner way to achieve this at the moment in blockly?
Thanks