Route.transitionTo causes a weird hashchange event when fired from view


#1

I’m configuring an action on my route to pass via a controller to a view menu item and configuring the click event to fire that action.

http://jsfiddle.net/2q329e04/1/

When the menu item is clicked, the transitionTo occurs, but then a hashchange fires immediately after the route changes and causes a second transition back to the index.

This is really stumping me. While the fiddle is using Ember 1.5.1, I was also able to replicate on 1.6.1 and 1.7.0-b4


#2

ARGH! This is caused because I was including an <a href="#'> in my template. Remove that, problem goes away.


#3

Be careful just flat removing the <a href="#"> - iOS devices get really pissy if a link doesn’t have an href element. Manifests itself in things like Bootstrap Accordions. I use <a href="javascript:void(0);"> and it seems to keep everyone happy and doesn’t drop the hash into the url.


#4

Thanks for the heads up, ultimatemonty. I’ll see if I can do that and find peace in the valley.