@keenmate/svelte-spa-router 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Router.svelte +5 -3
- package/package.json +1 -1
package/Router.svelte
CHANGED
|
@@ -222,15 +222,17 @@
|
|
|
222
222
|
|
|
223
223
|
if (!get(HashRoutingEnabled)) {
|
|
224
224
|
node.addEventListener("click", ev => {
|
|
225
|
+
ev.stopImmediatePropagation()
|
|
226
|
+
ev.preventDefault()
|
|
227
|
+
|
|
225
228
|
const linkTarget = ev.target.getAttribute("target")
|
|
226
229
|
if (linkTarget && linkTarget !== "_self") {
|
|
227
230
|
// prevent pushState when link is perhaps going outside of this window
|
|
231
|
+
window.open(node.getAttribute("href"), linkTarget)
|
|
232
|
+
|
|
228
233
|
return
|
|
229
234
|
}
|
|
230
235
|
|
|
231
|
-
ev.stopImmediatePropagation()
|
|
232
|
-
ev.preventDefault()
|
|
233
|
-
|
|
234
236
|
const shouldReplace = typeof opts !== "string" && opts.shouldReplace
|
|
235
237
|
|
|
236
238
|
jediForcePush(node.getAttribute("href"), shouldReplace)
|