haxeui / haxeui-kha

The Kha backend of the HaxeUI framework -
http://haxeui.org
MIT License
45 stars 16 forks source link

Textfield issues and incorrect textfield applied in tabview #63

Closed XANOZOID closed 1 year ago

XANOZOID commented 1 year ago

I have created a test app. Basically it comes in 2 parts login and create account. They're very similar. I have also attached a GIF of what happens. Currently, textfields may lag on input (as demonstrated twice in the gif on the password fields - but I've gotten regular textfields doing the same thing before). Then if you notice, I'm typing on the login page but the textfields from the create account page are the ones receiving the text.

The third problem is most obvious. If you click the login button I removed the whole component from the screen. If you start typing any letters or left/right arrows the textfields are apparently still hooked and throw an exception - you must be debugging and catching uncaught exceptions to see this error.

The fourth problem, not displayed, is that if you keep pressing backspace in an empty textfield you essentially break its positional information. Once you've pressed backspace enough times, try entering in some text - it will all be entered at the front of the character list instead of the back like normal. Using the arrows to correct it does not work.

So that's 4 problems 1: text field lag (slightly inconsistent). 2: selecting text fields in other tab view pages (fairly consistent). 3: text field events remain registered when their parents are removed from the tree. (consistent) 4: Pressing backspace repeatedly breaks typing in the text fields. (consistent)

Media

haxeuiexample

Test app / minimal test case

Attached is a similar test app to my last issue but with more haxeui components. testapp.zip

Context

Unresponsive/broken text fields make for an unpleasant user experience.

Your Environment

ianharrigan commented 1 year ago

Can you pull latest and retry? There were some oddities which i think have been fixed now.

Cheers, Ian

XANOZOID commented 1 year ago

Pulled latest haxeui-core (from haxelib) and pulled latest haxeui-kha (git).

Still experiencing the following: Point 1: There is still, random, chances where lag occurs when typing. It's like, when I first start typing I see nothing populate the text box. If I finish typing (while nothing is printing), then click the textbox again, it fills with what I typed (after the fact).

Point 3: Still in a situation where removing an element that contains the textbox somewhere down the component tree the event listeners don't appear to be unhooking. It may be that I'm removing the container element while the textbox is an active element? Like, within the button click event I remove the entire container while the textbox was active before I clicked the button that removes the container. It's possible to test if events weren't unhooked by debugging for uncaught exceptions by pressing character/digit keys after removing the container.

Point 4: It is still happening where if you hold the backspace or repeatedly tap it while the textbox is empty that the typing of the textbox becomes broken.

Thanks!

ianharrigan commented 1 year ago

OK, can you try with latest see how it fares? I cant reproduce #1 and im not entirely sure i understand #3, but i did fix something that i noticed that might be what you mean...

XANOZOID commented 1 year ago

After the most recent fix it looks like all points are fixed. Thanks!!