Skip to content

Commit

Permalink
Fixed active tab stolen on scroll with linked content tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Jun 6, 2024
1 parent b5b7e9d commit 1cc45d5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 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.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 %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import {
skip,
startWith,
subscribeOn,
switchMap,
takeUntil,
tap,
withLatestFrom
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 }))
Expand Down

0 comments on commit 1cc45d5

Please sign in to comment.