mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-24 07:30:12 +01:00
Fixed invalid tooltip position in tables when using table sort
This commit is contained in:
parent
7a770dc7be
commit
e5c9575dda
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>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script src="{{ 'assets/javascripts/bundle.471ce7a9.min.js' | url }}"></script>
|
<script src="{{ 'assets/javascripts/bundle.af256bd8.min.js' | url }}"></script>
|
||||||
{% for script in config.extra_javascript %}
|
{% for script in config.extra_javascript %}
|
||||||
{{ script | script_tag }}
|
{{ script | script_tag }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -27,6 +27,7 @@ import {
|
|||||||
Subject,
|
Subject,
|
||||||
animationFrameScheduler,
|
animationFrameScheduler,
|
||||||
combineLatest,
|
combineLatest,
|
||||||
|
combineLatestWith,
|
||||||
debounce,
|
debounce,
|
||||||
defer,
|
defer,
|
||||||
distinctUntilChanged,
|
distinctUntilChanged,
|
||||||
@ -138,7 +139,12 @@ export function watchTooltip2(
|
|||||||
defer(() => getElementContainers(el)).pipe(
|
defer(() => getElementContainers(el)).pipe(
|
||||||
mergeMap(watchElementContentOffset),
|
mergeMap(watchElementContentOffset),
|
||||||
throttleTime(1),
|
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
|
// Only track parent elements and compute offset of the tooltip host if the
|
||||||
|
Loading…
Reference in New Issue
Block a user