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

Don't trigger start animation when clicking on an button within anchor #31

Open
krehwell opened this issue Jul 26, 2023 · 4 comments
Open

Comments

@krehwell
Copy link

Considering this case

<a href="/username">
    <button 
        onClick={(e) => {
            e.stopPropagation();
            follow();
        }}>
        Follow
    </button>
</a>

Issue: When the button is clicked, the progress bar triggered
Expected: When the button is clicked, the progress bar should not do anything. There should be a way to prevent the progress bar to not being triggered

@baba43
Copy link

baba43 commented Aug 30, 2023

I am in the same boat (as mentioned here: #8)

@krehwell did you find any solution for your problem?

@krehwell
Copy link
Author

@baba43 ends up using this package instead: https://github.com/Skyleen77/next-nprogress-bar

works flawlessly for us

@donovanglover
Copy link

Should also work in #61 (comment)

@GiorgiTsukhishvili
Copy link

I had similar case and this seems to fix the issue

e.nativeEvent.stopImmediatePropagation();
so instead of e.stopPropagation() try calling it.

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

No branches or pull requests

4 participants