ianharrigan / haxeui

IMPORTANT NOTE! This repository is no longer maintained. Please consider the newer version: https://github.com/haxeui/haxeui-core
http://haxeui.org/
392 stars 46 forks source link

link is opened even if link is not visible #296

Closed sebthom closed 8 years ago

sebthom commented 9 years ago

When a link is for example hidden/overlayed by button (e.g. because of a stackview, scrollview) and one clicks the button the click event is also passed on to the hidden link and the browser is opened. Using event.stopPropagation or stopImmediatePropagation in the buttons event handler does not help.

ianharrigan commented 9 years ago

Im not quite sure i follow... Do you have some example code / xml of what you mean?

ianharrigan commented 9 years ago

Ah, although, looking at the impl for Link i think i can see what is happening - some example code would be good though anyway, just to make sure im understanding the problem

sebthom commented 9 years ago

try to click the link in this example. It will open the URL in the browser.

<?xml version="1.0" encoding="UTF-8"?>
<stack width="100%" height="100%">
    <vbox width="100%" height="100%">
        <button text="hello" />
    </vbox>
    <vbox width="100%" height="100%">
        <link text="http://archive.org/" style="fontSize:30" />
    </vbox>
</stack>
sebthom commented 9 years ago

Is there any easy workaround for this?

ianharrigan commented 9 years ago

Ill take a look at this over the weekend.

ianharrigan commented 8 years ago

Should be fixed now

sebthom commented 8 years ago

Looks like there is another corner case: The link is in a scroll view and fully or partially outside the scroll area, directly below the scroll view is a button. When you click the button while the URL is located below it, the link will open.

Examples:

http://haxeui.org/try.jsp?layoutId=ybanL4n

http://haxeui.org/try.jsp?layoutId=85oRAo8

ianharrigan commented 8 years ago

Hmmm, yeah... good catch...

ianharrigan commented 8 years ago

Should be fixed now: http://haxeui.org/try.jsp?layoutId=np8pn7d

sebthom commented 8 years ago

Works. Thanks!