Skip to content

Fix link event to reference currentTarget #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading