Skip to content

Commit 485fa76

Browse files
committed
Fixed edge case with anchor links when using instant navigation
1 parent d68db58 commit 485fa76

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

material/templates/assets/javascripts/bundle.5cfa9459.min.js renamed to material/templates/assets/javascripts/bundle.7c1205d0.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material/templates/assets/javascripts/bundle.5cfa9459.min.js.map renamed to material/templates/assets/javascripts/bundle.7c1205d0.min.js.map

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material/templates/base.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@
249249
</script>
250250
{% endblock %}
251251
{% block scripts %}
252-
<script src="{{ 'assets/javascripts/bundle.5cfa9459.min.js' | url }}"></script>
252+
<script src="{{ 'assets/javascripts/bundle.7c1205d0.min.js' | url }}"></script>
253253
{% for script in config.extra_javascript %}
254254
{{ script | script_tag }}
255255
{% endfor %}

src/templates/assets/javascripts/integrations/instant/index.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,11 @@ export function setupInstantNavigation(
370370
// the scroll restoration to the current page, as we don't need to restore
371371
// the viewport offset when the user navigates to a different page, as this
372372
// is already handled by the previous observable.
373-
location$.pipe(
373+
document$.pipe(
374+
switchMap(() => location$),
374375
distinctUntilKeyChanged("pathname"),
375376
switchMap(() => location$),
376-
distinctUntilKeyChanged("hash"),
377+
distinctUntilKeyChanged("hash")
377378
),
378379

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

0 commit comments

Comments
 (0)