Skip to content

Commit

Permalink
Fixed edge case with anchor links when using instant navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed May 15, 2024
1 parent d68db58 commit 485fa76
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion material/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.5cfa9459.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.7c1205d0.min.js' | url }}"></script>
{% for script in config.extra_javascript %}
{{ script | script_tag }}
{% endfor %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,11 @@ export function setupInstantNavigation(
// the scroll restoration to the current page, as we don't need to restore
// the viewport offset when the user navigates to a different page, as this
// is already handled by the previous observable.
location$.pipe(
document$.pipe(
switchMap(() => location$),
distinctUntilKeyChanged("pathname"),
switchMap(() => location$),
distinctUntilKeyChanged("hash"),
distinctUntilKeyChanged("hash")
),

// Handle instant navigation events that are triggered by the user clicking
Expand Down

0 comments on commit 485fa76

Please sign in to comment.