exta2 0.0.1-beta.29 → 0.0.1-beta.30

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.
@@ -55,12 +55,12 @@ function Link({ href, onClick, prefetch, preload, ...props }) {
55
55
  if (e.defaultPrevented || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || props.target === "_blank")
56
56
  return;
57
57
  let current = window.location, target = new URL(href, current.href), isHashOnly = href.startsWith("#"), isSamePath = target.pathname === current.pathname, isHashChange = target.hash && target.hash !== current.hash;
58
- if (!(isHashOnly || isSamePath && isHashChange) && (e.preventDefault(), e.stopPropagation(), !(onClick && (await onClick(e), e.defaultPrevented)))) {
58
+ if (!(isHashOnly || isSamePath && isHashChange) && !(onClick && (await onClick(e), e.defaultPrevented))) {
59
59
  if (isExternal(href)) {
60
60
  window.location.href = href;
61
61
  return;
62
62
  }
63
- await extaRouter.goto(target.pathname), router.push(target.pathname + target.search + target.hash);
63
+ e.preventDefault(), e.stopPropagation(), await extaRouter.goto(target.pathname), router.push(target.pathname + target.search + target.hash);
64
64
  }
65
65
  } }, props.children);
66
66
  }
@@ -19,12 +19,12 @@ function Link({ href, onClick, prefetch, preload, ...props }) {
19
19
  if (e.defaultPrevented || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || props.target === "_blank")
20
20
  return;
21
21
  let current = window.location, target = new URL(href, current.href), isHashOnly = href.startsWith("#"), isSamePath = target.pathname === current.pathname, isHashChange = target.hash && target.hash !== current.hash;
22
- if (!(isHashOnly || isSamePath && isHashChange) && (e.preventDefault(), e.stopPropagation(), !(onClick && (await onClick(e), e.defaultPrevented)))) {
22
+ if (!(isHashOnly || isSamePath && isHashChange) && !(onClick && (await onClick(e), e.defaultPrevented))) {
23
23
  if (isExternal(href)) {
24
24
  window.location.href = href;
25
25
  return;
26
26
  }
27
- await extaRouter.goto(target.pathname), router.push(target.pathname + target.search + target.hash);
27
+ e.preventDefault(), e.stopPropagation(), await extaRouter.goto(target.pathname), router.push(target.pathname + target.search + target.hash);
28
28
  }
29
29
  } }, props.children);
30
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exta2",
3
- "version": "0.0.1-beta.29",
3
+ "version": "0.0.1-beta.30",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",