ArcBees / gwtquery

A jQuery clone for GWT, and much more.
MIT License
85 stars 38 forks source link

e.preventDefault() does not work #286

Closed cjin-zafin closed 10 years ago

cjin-zafin commented 10 years ago

giving a situation that

@UiField InlineHyperlink name;

$(name).bind(Event.ONCLICK, disabledFunction);

disabledFunction = new Function() { @Override public boolean f(Event e) { e.preventDefault();

            return false;
        }
    };

when click on the InlineHyperlink, the stack trace went to e.preventDefault(), but the url reveal was still triggered.

also tried

e.stopPropagation(); e.preventDefault();

not working either.

on FireFox 26, IE 11, none of these browsers are working

gwtquery version from 1.4.0 - 1.4.2

jDramaix commented 10 years ago

Event is a GWT object. So if the preventDefault() method doesn't work as expected, you should open an issue in the GWT project directly.

No for achieving what you want you can also do :

$(name).attr("href", "javascript:;");

On Tue, May 13, 2014 at 10:24 PM, Chong notifications@github.com wrote:

giving a situation that

@UiField InlineHyperlink name;

$(name).bind(Event.ONCLICK, disabledFunction);

disabledFunction = new Function() { @Override https://github.com/Override public boolean f(Event e) { e.preventDefault();

        return false;
    }
};

when click on the InlineHyperlink, the stack trace went to e.preventDefault(), but the url reveal was still triggered.

also tried

e.stopPropagation(); e.preventDefault();

not working either.

on FireFox 26, IE 11, none of these browsers are working

gwtquery version from 1.4.0 - 1.4.2

— Reply to this email directly or view it on GitHubhttps://github.com/gwtquery/gwtquery/issues/286 .