1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-28 09:20:52 +01:00

Fixed #2703: search remains at 'Initializing search' on mobile

This commit is contained in:
squidfunk 2021-05-27 11:36:08 +02:00
parent bcbe24224c
commit 409d151044
8 changed files with 26 additions and 12 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -39,7 +39,7 @@
{% endif %}
{% endblock %}
{% block styles %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.10e03543.min.css' | url }}">
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.66ec5ba4.min.css' | url }}">
{% if config.theme.palette %}
{% set palette = config.theme.palette %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.f1a3b89f.min.css' | url }}">
@ -223,7 +223,7 @@
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.a6b08407.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.70ffd0a1.min.js' | url }}"></script>
{% for path in config["extra_javascript"] %}
<script src="{{ path | url }}"></script>
{% endfor %}

View File

@ -35,6 +35,7 @@ import {
observeOn,
startWith,
switchMap,
take,
tap,
withLatestFrom,
zipWith
@ -53,6 +54,7 @@ import {
import {
SearchResult as SearchResultData,
SearchWorker,
isSearchReadyMessage,
isSearchResultMessage
} from "~/integrations"
import { renderSearchResult } from "~/templates"
@ -107,8 +109,21 @@ export function mountSearchResult(
filter(Boolean)
)
/* Update search result metadata */
/* Retrieve nested components */
const meta = getElementOrThrow(":scope > :first-child", el)
const list = getElementOrThrow(":scope > :last-child", el)
/* Update search result metadata when ready */
rx$
.pipe(
filter(isSearchReadyMessage),
take(1)
)
.subscribe(() => {
resetSearchResultMeta(meta)
})
/* Update search result metadata */
internal$
.pipe(
observeOn(animationFrameScheduler),
@ -122,7 +137,6 @@ export function mountSearchResult(
})
/* Update search result list */
const list = getElementOrThrow(":scope > :last-child", el)
internal$
.pipe(
observeOn(animationFrameScheduler),