feathersui-starling
feathersui-starling copied to clipboard
StageTextTextEditor: dispatches FeathersEventType.SOFT_KEYBOARD_DEACTIVATE twice
Hi Josh,
I noticed that when clearing the Focus of a TextInput, the StageTextTextEditor dispatches twice the deactivate Event: this.dispatchEventWith(FeathersEventType.SOFT_KEYBOARD_DEACTIVATE, true); don't seem to understand why. The event is the very same object.
~~~The `SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATING` is helpful to start animating the screen towards a previously saved SoftKeyboard-height value before the `SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATE` is dispatched with the final keyboard height.~~~
~~~At least I know no other way to get this values or events :)~~~
Best regards
I noticed that when clearing the Focus of a TextInput, the StageTextTextEditor dispatches twice the deactivate Event: this.dispatchEventWith(FeathersEventType.SOFT_KEYBOARD_DEACTIVATE, true); don't seem to understand why. The event is the very same object.
Thanks! I'll investigate.
Also, I was wondering, is there is any particular reason why you listen to the SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATE and SoftKeyboardEvent.SOFT_KEYBOARD_DEACTIVATE events but not the SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATING?
Because I figured that the activating event was only useful for being cancelable, which is usually tricky to implement on the Starling side because Starling events don't have that feature out of the box. I decided to wait and see if people would ask for it or not.
The SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATING is helpful to start animating the screen towards a previously saved SoftKeyboard-height value before the SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATE is dispatched with the final keyboard height.
This is a perfectly legitimate reason to want that event. I'll make sure to add it.
I have determined that flash.text.StageText simply dispatches SoftKeyboardEvent.SOFT_KEYBOARD_DEACTIVATE twice:
var x1:Number = 10;
var y1:Number = 10;
var w1:Number = 350;
var h1:Number = 60;
this.graphics.beginFill(0xcccccc);
this.graphics.drawRect(x1, y1, w1, h1);
this.graphics.endFill();
var stageText1:StageText = new StageText();
stageText1.text = "Tap inside then out to deactivate";
stageText1.fontSize = 20;
stageText1.viewPort = new Rectangle(x1, y1, w1, h1);
stageText1.stage = stage;
stageText1.addEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_DEACTIVATE, function(event:SoftKeyboardEvent):void
{
trace("soft keyboard deactivate");
});
AIR-4198248: StageText: dispatches SoftKeyboardEvent.SOFT_KEYBOARD_DEACTIVATE twice
I have the same issue.