Fixed rendering of tab indicator of nested content tabs

This commit is contained in:
squidfunk
2024-04-25 10:18:10 +07:00
parent 374bbab9d3
commit 2d07a6aa6e
4 changed files with 14 additions and 11 deletions

View File

@@ -38,6 +38,7 @@ import {
skip,
startWith,
subscribeOn,
switchMap,
takeUntil,
tap,
withLatestFrom
@@ -53,7 +54,8 @@ import {
getElementSize,
getElements,
watchElementContentOffset,
watchElementSize
watchElementSize,
watchElementVisibility
} from "~/browser"
import { renderTabbedControl } from "~/templates"
import { h } from "~/utilities"
@@ -284,8 +286,9 @@ export function mountContentTabs(
})
/* Create and return component */
return watchContentTabs(inputs)
return watchElementVisibility(el)
.pipe(
switchMap(() => watchContentTabs(inputs)),
tap(state => push$.next(state)),
finalize(() => push$.complete()),
map(state => ({ ref: el, ...state }))