1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-23 23:21:00 +01:00

Fixed active tab stolen on scroll with linked content tabs

This commit is contained in:
squidfunk 2024-06-06 12:01:24 +01:00
parent b5b7e9d678
commit 1cc45d50d0
No known key found for this signature in database
GPG Key ID: 5ED40BC4F9C436DF
4 changed files with 9 additions and 11 deletions

View File

@ -249,7 +249,7 @@
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.081f42fc.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.ad660dcc.min.js' | url }}"></script>
{% for script in config.extra_javascript %}
{{ script | script_tag }}
{% endfor %}

View File

@ -38,7 +38,6 @@ import {
skip,
startWith,
subscribeOn,
switchMap,
takeUntil,
tap,
withLatestFrom
@ -137,7 +136,7 @@ export function mountContentTabs(
return defer(() => {
const push$ = new Subject<ContentTabs>()
const done$ = push$.pipe(ignoreElements(), endWith(true))
combineLatest([push$, watchElementSize(el)])
combineLatest([push$, watchElementSize(el), watchElementVisibility(el)])
.pipe(
takeUntil(done$),
auditTime(1, animationFrameScheduler)
@ -286,9 +285,8 @@ export function mountContentTabs(
})
/* Create and return component */
return watchElementVisibility(el)
return watchContentTabs(inputs)
.pipe(
switchMap(() => watchContentTabs(inputs)),
tap(state => push$.next(state)),
finalize(() => push$.complete()),
map(state => ({ ref: el, ...state }))