Proposed fix for bug 921317 (using preventDefault)

See https://bugzilla.mozilla.org/show_bug.cgi?id=921317#c51 and https://bugzilla.mozilla.org/show_bug.cgi?id=921317#c53