yui/yui3 — pull request #407 by tilomitra (2013-01-17 21:52:44+00:00)
Title: Fix for #2532831 (Tap events inside of a View modify URL even with preventDefault)

This pull request fixes [#2532831](http://yuilibrary.com/projects/yui3/ticket/2532831). Thanks to @ericf and @lsmith for helping me out with it.

I've tested this in IE6,7,8,9,10, Latest Chrome, Latest FF, Safari6, iOS6 and Android 4.0.3. It works everywhere, but is not as reliable in IE9 for some reason. It seems on IE9, the mouseup does not trigger the appropriate callback, and the `fire` never gets called.

I'd also appreciate some advice on how to unit test this functionality. I was trying to do the following without success.

var tapped = false;

//node is foo
node.on('tap', function(e) {
e.preventDefault();
tapped = true;
};
node.tap(startOpts, endOpts);
node.simulate('click');

//Check to make sure callback was called.
Y.Assert.isTrue(tapped);

//check that was not triggered because of e.preventDefault()
Y.Assert.areEqual(Y.config.win.location.pathname.indexOf('#foo'), -1);

For the time being, I've added a manual test which I've tested on the above-mentioned browsers.