hackmd-io-issues
hackmd-io-issues copied to clipboard
Browser always jumps back to last anchor link on any click in document (Safari only?)
Is this a hackmd.io issue?
- [X] Yes, the bug happens on https://hackmd.io
- [ ] No. If it's a self-hosted CodiMD instance, please fire up the issue in the repo of CodiMD: https://github.com/hackmdio/codimd
What's the problem
Current behaviour
When I jump in a document to a heading link (from the TOC or an anchor hash added to URL) and then scroll away from that position, it always jumps back to this anchor whenever I click anywhere else in the document.
This seems to happen only in Safari, on mobile and desktop. At least I tested it only in Chrome and Safari.
Provide steps to reproduce:
- Open a HackMD document in Safari.
- Click on an internal link, like from the table of contents, to jump there.
- Scroll away from the link target.
- Click anywhere like on the document background and it jumps back to the last anchor link.
Expected behaviour
Nothing should happen when I click in this case.
Environment
I use HackMD on:
Desktop
- OS: macOS
- Browser: Safari
- Browser Version: 14.1.2
Mobile
- Device: iPhone
- OS: iOS 15.5
- Browser: Safari