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

Any way to have a deeplink work from the page it links to? #1

Open
rouilj opened this issue Dec 12, 2021 · 1 comment
Open

Any way to have a deeplink work from the page it links to? #1

rouilj opened this issue Dec 12, 2021 · 1 comment

Comments

@rouilj
Copy link

rouilj commented Dec 12, 2021

My use case is to provide links to an update on a ticket. For example:

https://rouilj.dynamic-dns.net/demo/issue439#29VHfN7-JF:5H:8Z

links to text inside a message on a ticket. This works fine when the link is not
located on the page https://rouilj.dynamic-dns.net/demo/issue439 itself.
If you click on the link (see https://rouilj.dynamic-dns.net/demo/issue439#msg36017)
many times it does nothing.

I think the browser sees that the links is to the same page. As a result it doesn't reload the page. It looks for
an element with a matching id. Since that id doesn't exist on the page it fails.

Any idea on how to fix this? Maybe add a document listener for click. If the listener detects one of deeplink's
links it jumps down the page and selects the text.

Alternatively is there a function I can call to trigger deeplink if I pass it a fragment/url?

@WesleyAC
Copy link
Owner

This is a reasonable feature request, I'll take a look at implementing it. There's some complexity in making sure that the script itself changing the hash doesn't trigger scrolling/etc, but that shouldn't be too hard to fix.

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

2 participants