-
-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TextField on html5 target only accessible with mouse after changing content programmatically #1285
Comments
This is working for me on the latest source of OpenFL and Lime: package;
import openfl.display.Sprite;
import openfl.events.TimerEvent;
import openfl.text.TextField;
import openfl.utils.Timer;
class Main extends Sprite {
public function new () {
super ();
var textField = new TextField ();
textField.text = "Hello";
textField.type = INPUT;
addChild (textField);
var timer = new Timer (2000);
timer.addEventListener (TimerEvent.TIMER, function (_) {
textField.text += "h";
});
timer.start ();
}
} (I can click into the field, type or remove characters, and focus persists, even as additional characters are added at the end) Are you using -Dcanvas or -Ddom? The above is working for GL. It is also possible that this was improved since the last release, or that there is something more complex happening in your code that is changing focus |
If you modify it like this, the error occurs:
|
(the important change is that I assign the text field something rather than just concatenating. Upon assigning text, it loses focus and must be clicked again to refocus. |
The bug also happens on neko. |
When I use a dynamic TextField for user input on html5 targets, and I programmatically change its content, the text field loses focus and becomes inaccessible except through clicking on it again with the mouse. The event handlers for the focus get called properly if I try focusing it through other means (e.g. by setting stage.focus), but it is not possible to input text with the keyboard unless the text field is clicked on. After clicking on it once, it remains accessible until the content is again changed in the program.
The text was updated successfully, but these errors were encountered: