haxeui / haxeui-core

The core library of the HaxeUI framework

Home Page:http://haxeui.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

List hard to select item on Windows and android with hxpp

hypergeome opened this issue · comments

I have a list of items of different height.
When selecting an item, the row will change with addtional data.

But it is hard to select a row. It requires many click. This doe snot happen with haxeui-core 1.2.3, but happens with 1.4.0

Expected Behavior

List row can be selected easily.

Current Behavior

List rows are hard to select.

Possible Solution

Steps to Reproduce (for bugs)

  1. Run app
  2. List is displayed with 2 items
  3. Try clicking on an item till it is selected and display addtional buttons.
  4. Then try clicking on other item.
  5. You will see that it is hard to make the row being selected.

Media

Test app / minimal test case

ContactManager.zip

Context

Your Environment

C:\Windows\system32>haxelib list
actuate: [1.8.9]
air4haxe: [1.0.0]
akifox-asynchttp: [0.4.7]
box2d: [1.2.3]
haxe-crypto: [0.0.7]
haxeui-core: 1.2.3 [1.4.0]
haxeui-openfl: 1.2.3 [1.4.0] git
haxeui: [1.8.21]
hscript: [2.4.0]
hxcpp-debug-server: [dev:c:\Users\Subin.vscode\extensions\vshaxe.hxcpp-debugger-1.2.4\hxcpp-debug-server]
hxcpp: [4.2.1]
layout: [1.2.1]
lime-samples: [7.0.0]
lime: [7.9.0]
msignal: [1.2.5]
openfl-samples: [8.7.0]
openfl: [9.1.0]
thx.core: [0.44.0]
thx.promise: [0.7.0]

ill check it out - is there any chance you can try to use haxeui-core and haxeui-openfl from git? there have been many changes since 1.4.0 so would be good to know if this is still an issue there.

Cheers,
Ian

Yes, confirmed, The issue is still there on latest git version of haxeui-core and haxui-openfl. But version 1.2.3 does not have this issue.

OK, thanks for trying, ill test it when i get a little time and see whats going on.

Cheers,
Ian

OK, so after a lot of debugging ive found your issue:

the problem is that you have a list embedded in a list - the second list is "longTextDisplay" - when you click on this it stops the selection in the parent list - this is by design, any interactive component (which list is) will stop a list item from being selected. You can get around this by using the allowInteraction property on the sublist.

Another small note, you are using a listview inside a listview to wrap text so it scrolls, listview is pretty heavy and this seems like a really crazy use of it, i mean, its fine, but it just seems totally overboard :)

Instead i would just use a scrollview which is much lighter, ie:

<scrollview id="longTextWrapperList" width="100%" height="100%" contentWidth="100%" style="border:none" allowInteraction="false">
    <label width="100%" id="longTextData" styleName="txtLongTextFieldData"/>
</scrollview>	

Obviously you'll now need to change some code to set the label (rather than the listview datasource), but the effect is the same, and its much lighter (note you still need the allowInteraction because scrollview is also an interacting component)

Finally, in future it would be alot more helpful to reproduce your issues to something much smaller... the attached app is huge, with lots of files and lots of code - it took me a long time to even just get to the "right" parts of the app - let alone understand how they interact. I simply cant spend that long trying to understand a problem when a minimal test case would have shown it perfectly and a helluva lot simpler. :)

For completeness this, minimal repro would have explained the issue perfectly (and a million time more simpler): http://haxeui.org/builder/?wuivke

(it also shows the fix).

Cheers,
Ian

Thank you.

So, three are many things about this - just FYI:

  1. I have been using haxeui-core since the early days (thank you alot for creating this lib), and it has been gone through a bunch of versions. I dont remember why, but I had to use listview inside listview because label inside scrollview did not work before (I mean earlier versions of haxeui-core). Also, textarea did not work. What I need was simply a control to display long text and can be scrolled by "swipping", i.e. no need to use scroll bars but can be scrolled by touching the control and just drag because our app will be running on both windows and android and the scroll bars sometimes are too small to be touched by fingers.

  2. For haxeui-core 1.2.3, the sample code works fine and no need allowInteraction.

  3. I used this - kind of big - sample project because I already used it just previous week for the startup crashing issue before. So, I already have it in place :). Sorry that this bother you. Will create simpler project that focusing on the issue the next time.
    Again, thank you alot.

Cheers,

Yeah, haxeui has defo gone through a bunch of changes, and continues to :)

I dont remember when i added the "not allowing interactives to set selection", but i guess it was after 1.2.3 - its defo a good / important change

No problem about the test app being big, its just a note that things take me 100 times longer if i have to "parse" a 3rd party app, rather than just the problem. :)

Glad its working!

Cheers,
Ian