Skip to content

fix: Ensure user-provided onclick event in Link component doesn't override internal onclick - #52

Merged
webJose merged 2 commits into
mainfrom
JP/Link-onclick
Sep 7, 2025
Merged

fix: Ensure user-provided onclick event in Link component doesn't override internal onclick#52
webJose merged 2 commits into
mainfrom
JP/Link-onclick

Conversation

@webJose

@webJose webJose commented Sep 7, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@webJose
webJose requested a review from Copilot September 7, 2025 04:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug where user-provided onclick handlers were being overridden by the internal navigation logic in the Link component. The fix ensures that both the internal navigation and any user-provided onclick handlers are executed.

  • Extracts user-provided onclick handler from props to prevent it from being overridden
  • Calls the user-provided onclick handler after internal navigation logic
  • Improves the type annotation for the handleClick event parameter

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/lib/Link/Link.svelte Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@webJose
webJose merged commit 35d1f3d into main Sep 7, 2025
1 check passed
@webJose
webJose deleted the JP/Link-onclick branch September 7, 2025 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants