comments icon indicating copy to clipboard operation
comments copied to clipboard

New setting to disable location.hash history update on comment submit

Open vonscriptor opened this issue 9 months ago • 4 comments

What are you trying to do?

After a comment is made the URL is hashed with the comment ID, but this isn't useful in my case. I'd like a setting to disable this functionality.

Reasons: I'm loading comments via [Sprig] AJAX so it's likely that the submitted comment might not be available on the initial page load. Also, the page scroll jump is unwanted and my users likely won't want to copy a URL to the comment.

I can listen to a window hashchange event, but there is still a page scroll jump before I clear out the hash with my own history.replaceState, and it clutters up the history. So I don't feel I have a good solution.

What's your proposed solution?

Please add a Comments > Settings > Default Templates setting to Disable comment submit hash.

Additional context

No response

vonscriptor avatar Apr 15 '25 05:04 vonscriptor