Skip to content

Commit

Permalink
Fix link reference to currentTarget (#49)
Browse files Browse the repository at this point in the history
Co-authored-by: Archmonger <[email protected]>
  • Loading branch information
stevej2608 and Archmonger authored Jan 7, 2025
1 parent 53f5488 commit 44f76d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ Using the following categories, list your changes in this order:

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

### Fixed

- Fixed bug where `link` element sometimes would sometimes not retrieve the correct `href` attribute.

## [1.0.3] - 2024-11-21

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/reactpy_router/static/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ document.querySelector(".UUID").addEventListener(
// Prevent default if ctrl isn't pressed
if (!event.ctrlKey) {
event.preventDefault();
let to = event.target.getAttribute("href");
let to = event.currentTarget.getAttribute("href");
let new_url = new URL(to, window.location);

// Deduplication needed due to ReactPy rendering bug
Expand Down

0 comments on commit 44f76d2

Please sign in to comment.