Skip to content

Commit

Permalink
Avoid flicker when scrolling to anchor (#7263)
Browse files Browse the repository at this point in the history
* Avoid flicker when scrolling to anchor

* Fix
  • Loading branch information
philippjfr authored Sep 12, 2024
1 parent d90097b commit b69b78b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion panel/models/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ export class HTMLView extends PanelMarkupView {
}
})
if (!this.root.has_finished() && this.model.document && window.location.hash === link) {
this.model.document.on_event("document_ready", () => setTimeout(() => anchor.scrollIntoView(), 5))
this.model.document.on_event("document_ready", () => {
anchor.scrollIntoView()
setTimeout(() => anchor.scrollIntoView(), 5)
})
}
}
}
Expand Down

0 comments on commit b69b78b

Please sign in to comment.