StablexUI icon indicating copy to clipboard operation
StablexUI copied to clipboard

Invisible content extending outside scroller in HTML5 target

Open jonmoat opened this issue 10 years ago • 5 comments

This is related to a previous post about visible content appearing outside the scroller in HTML5.

Box content outside the scroller is not visible but it is masking other content (dependent on layer) and taking mouse events (overflow = false).

I have added a mouseClick listener to the Scroll widget in the samples (using the map). If I click outside the scroller over a point where the map virtually is when scrolled, it is taken.

With the vertical NME scroller in the same example, scrolling can be achieved by dragging above or below (outside) the scroller.

Any thoughts on how to fix this? It is currently breaking our app.

openfl: [2.0.1], Haxe: [3.1.3], stablexui: [1.0.17]

jonmoat avatar Jan 22 '15 12:01 jonmoat

You can try following workaround: On mouse event check if event coordinates are out of Scroll boundaries. If so, get next object under Scroll with .getObjectsUnderPoint() and fire event on that object.

RealyUniqueName avatar Jan 23 '15 08:01 RealyUniqueName

Thanks for the suggestion - we'll try that. Could you please give some example code of how to fire a mouse event on the object?

jonmoat avatar Jan 26 '15 08:01 jonmoat

Just to clarify, is this an issue with Stablexui or is it the HTML5 backend in Openfl? (I'd like to know whether I should pursue it further on the Openfl forum.)

jonmoat avatar Jan 26 '15 08:01 jonmoat

it's an issue of OpenFL's html5 backend.

Code should look like this:

scroll.addEventListener(MouseEvent.CLICK, function(e:MouseEvent) {
    if (e.localX < || e.localX > scroll.w || e.localY < 0 || e.localY > scroll.h) {
        e.stopImmediatePropagation();
        var objList = Lib.current.stage.getObjectsUnderPoint(new Point(e.stageX, e.stageY);
        var nextObj = ... //iterate through objList to find next object below scroll
        nextObj.dispatchEvent(new MouseEvent(MouseEvent.CLICK, ....));
    }
});

RealyUniqueName avatar Jan 26 '15 08:01 RealyUniqueName

OK - thank you for the code. Much appreciated.

jonmoat avatar Jan 26 '15 12:01 jonmoat