Skip to content
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

TextAreas onblur #474

Open
hoseyjoe opened this issue Aug 2, 2022 · 3 comments
Open

TextAreas onblur #474

hoseyjoe opened this issue Aug 2, 2022 · 3 comments

Comments

@hoseyjoe
Copy link
Contributor

hoseyjoe commented Aug 2, 2022

I have a text area that I would like to save data when the field loses focus. Its element.onblur event doesnt appear to work. So I tried

this.registerEvent(FocusEvent.FOCUS_OUT, (e) -> {
trace("Boom2");
});

When you click outside of the textfield it loses the caret but the textfield still appears to retain focus style, though it doesnt accept key entree, until you click on another interactiveobject

@hoseyjoe
Copy link
Contributor Author

hoseyjoe commented Aug 3, 2022

In haxe.ui.focus.FocusManager.hx if you uncomment lines 37 and remove 41 then you can get a blur event to pass through, or at least adding a break point on 43 will work when clicking into a textfield and then clicking anywhere else.

@hoseyjoe
Copy link
Contributor Author

hoseyjoe commented Aug 5, 2022

In discussion it was decided to make sure that clicking outside and field still maintains focus. Focusout only fires when focus on another interactiveobject occurs. This appears to be more universal

@ianharrigan
Copy link
Member

Worth adding that clicking outside a focusable object that accepts text input (like textfield / textarea) on html5 has issues: the field remains visually focused (haxeui thinks its still focused), but you cant input text anymore (the browser doesnt think its focused) - this should be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants