haxeui / haxeui-openfl

The OpenFL backend of the HaxeUI framework -
http://haxeui.org
MIT License
42 stars 14 forks source link

Scrollbar not sliding on haxeui-openfl html5 target #31

Closed ConfidantCommunications closed 5 years ago

ConfidantCommunications commented 5 years ago

Expected Behavior

Scrollbar component slider should move up and down when dragged with mouse. Should also respond to browser scroll event. Arrow buttons on top and bottom should cause scrolling in small increments.

Current Behavior

When using mouse to drag the slider, the content scrolls up and down but the slider graphic does not move. Clicking the arrow buttons has no result.

Possible Solution

No ideas right now; I'm a HaxeUI newbie.

Steps to Reproduce (for bugs)

  1. Use new-component-method branch of haxeui-core and haxeui-openfl
  2. Compile the component-examples/responsive/ code using openfl test html5
  3. View the result in browser at http://127.0.0.1:3000/ then make the window narrow and use the scrollbar.

Media

Test app / minimal test case

Compile the component-examples/responsive/ code using openfl test html5

Context

Testing HaxeUI with end goal of applying WebGL effects to its canvas. No code added related to that part yet.

Your Environment

ianharrigan commented 5 years ago

Hmmm yeah, something not right there. Ill check it out.

ianharrigan commented 5 years ago

Ah, I know what it is:

Ok, so in new-component-method branch there are things like scrollveiw2 as well as the normal scrollview... scrollview2 is the "new" version and will become scrollview soon. The reason it isnt yet is a) for reference and b) because there are other container components that rely on scrollview (like listview) - so at the moment there are two versions of, for example, a scrollview. If you edit the main.xml and change the root scrollview to scrollview2 then it should work correctly.

Its a bit of a pain, i realise, but hopefully this will be cleared up asap.

ConfidantCommunications commented 5 years ago

This change works for me. There is still no response to the mouse scroll wheel but I'm guessing that hasn't been implemented yet. Thanks!

ianharrigan commented 5 years ago

Well, the mouse wheel is an annoying thing about openfl. I think its the same in flash, that it wont get mouse events unless there is something drawn on it, so for example, if you make the background white, then it will all work fine:

<scrollview2 width="100%" height="100%" contentWidth="100%" style="border-size:0;background-color: white;">

Im not sure its correct to make the background of all components draw "something" (even if its invisible) to their backgrounds as i think that would come with a performance cost. As i mentioned, its only openfl, and, as far as im aware, openfl is emulating the same behavior that flash exhibits (im no expert on either).

ConfidantCommunications commented 5 years ago

Wow, that's good to know. Your solution works once again and I will make sure to take note of that in future, thanks!