Skip to content

Commit 44f76d2

Browse files
Fix link reference to currentTarget (#49)
Co-authored-by: Archmonger <[email protected]>
1 parent 53f5488 commit 44f76d2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ Using the following categories, list your changes in this order:
3838

3939
- Set upper limit on ReactPy version to `<2.0.0`.
4040

41+
### Fixed
42+
43+
- Fixed bug where `link` element sometimes would sometimes not retrieve the correct `href` attribute.
44+
4145
## [1.0.3] - 2024-11-21
4246

4347
### Fixed

src/reactpy_router/static/link.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ document.querySelector(".UUID").addEventListener(
44
// Prevent default if ctrl isn't pressed
55
if (!event.ctrlKey) {
66
event.preventDefault();
7-
let to = event.target.getAttribute("href");
7+
let to = event.currentTarget.getAttribute("href");
88
let new_url = new URL(to, window.location);
99

1010
// Deduplication needed due to ReactPy rendering bug

0 commit comments

Comments
 (0)