mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-08-01 02:08:46 -04:00
Fixed invalid tooltip position in tables when using table sort
This commit is contained in:
@@ -27,6 +27,7 @@ import {
|
||||
Subject,
|
||||
animationFrameScheduler,
|
||||
combineLatest,
|
||||
combineLatestWith,
|
||||
debounce,
|
||||
defer,
|
||||
distinctUntilChanged,
|
||||
@@ -138,7 +139,12 @@ export function watchTooltip2(
|
||||
defer(() => getElementContainers(el)).pipe(
|
||||
mergeMap(watchElementContentOffset),
|
||||
throttleTime(1),
|
||||
map(() => getElementOffsetAbsolute(el))
|
||||
// Note that we need to poll the value again if the active state changes,
|
||||
// as otherwise the tooltip might be misplaced. This particularly happens
|
||||
// when using third-party integrations like tablesort that change the
|
||||
// position of elements – see https://t.ly/Y-V7X
|
||||
combineLatestWith(active$),
|
||||
map(() => getElementOffsetAbsolute(el)),
|
||||
)
|
||||
|
||||
// Only track parent elements and compute offset of the tooltip host if the
|
||||
|
||||
Reference in New Issue
Block a user