Skip to content

Commit 598cec2

Browse files
authored
Fix scroll top when clicking on htmx link (#1135)
1 parent 96a79b9 commit 598cec2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Elastic.Markdown/Assets/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ document.addEventListener('htmx:beforeRequest', function (event) {
5656
document.body.addEventListener('htmx:oobBeforeSwap', function (event) {
5757
// This is needed to scroll to the top of the page when the content is swapped
5858
if (
59+
event.target.id === 'main-container' ||
5960
event.target.id === 'markdown-content' ||
6061
event.target.id === 'content-container'
6162
) {

0 commit comments

Comments
 (0)