mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed active tab stolen on scroll with linked content tabs
This commit is contained in:
parent
b5b7e9d678
commit
1cc45d50d0
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -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 %}
|
||||
|
@ -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 }))
|
||||
|
Loading…
Reference in New Issue
Block a user