This is not an API bug per se, but it just weird for it not to be a native feature.
What I needed was to simply add a callback to endFocus of an inputField; problem is, from what I looked on the code, InputElement does have public signals:
public focusIn: Phaser.Signal = new Phaser.Signal(); public focusOut: Phaser.Signal = new Phaser.Signal();
But InputElement itself is a private element of InputElement, therefore hiding both signals from user access. My solution was to hardcode a callback using closures, as seen on this gist.
I think it would make more sense to expose both signals as events in the inputField object.
PS: I tried messing with the typescript code, but I'm a Grunt newbie and I couldn't build from source.
This is not an API bug per se, but it just weird for it not to be a native feature.
What I needed was to simply add a callback to endFocus of an inputField; problem is, from what I looked on the code, InputElement does have public signals:
public focusIn: Phaser.Signal = new Phaser.Signal(); public focusOut: Phaser.Signal = new Phaser.Signal();
But InputElement itself is a private element of InputElement, therefore hiding both signals from user access. My solution was to hardcode a callback using closures, as seen on this gist.
I think it would make more sense to expose both signals as events in the inputField object.
PS: I tried messing with the typescript code, but I'm a Grunt newbie and I couldn't build from source.