Pushstate ignores target attribute, key modifiers

When an anchor element href updates the route and when it has the target attribute set (in this case to _blank) or when a user clicks on an anchor tag with the CTRL key pressed, we expect that the target link would open in a new tab.

When using the Pushstate plugin, the anchor handler doesn’t take these use cases in consideration. The solution is to have a click handler that opens the window manually.

I’m not sure if this is by design or if this might be an oversight.

I couldn’t get push state to work properly in JSBin so I made a quick test page instead.

We decided a can.view.attr is the best solution for this in our project but I thought I’d ask in case either documentation needs updating or perhaps it is a bug.

This is a bug. An easy one to fix. We just have to make push state not call .preventDefault in these cases.