Skip to content
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

fix: click event triggered twice leads to repeated execution of the router.go method #996

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
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
8 changes: 0 additions & 8 deletions src/client/theme-default/components/VPAlgoliaSearchBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,6 @@ function initialize(userOptions: DefaultTheme.AlgoliaSearchOptions) {
if (route.path === relativeHit) {
return
}

// if the hits goes to another page, we prevent the native link
// behavior to leverage the Router loading feature.
if (route.path !== relativeHit) {
event.preventDefault()
}

router.go(relativeHit)
Copy link
Member

@brc-dd brc-dd Jul 15, 2022

Choose a reason for hiding this comment

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

If we are removing these then there is no need to provide the onClick prop, there is nothing being done there except for this. If I am correct, then we can remove that safely as this part of the code handles all the links. Might need to discuss this first with others.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @brc-dd , have you discussed the solution yet?

},

children
Expand Down