Cap tag matches to 10 on macOS/Qt5 to work around Chromium perf issue

Closes #1825
This commit is contained in:
Damien Elmes 2022-04-27 19:23:07 +10:00
parent a989e50838
commit 6f0d86b9a9

View File

@ -8,6 +8,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import Popover from "../../components/Popover.svelte";
import WithFloating from "../../components/WithFloating.svelte";
import { isApplePlatform } from "../../lib/platform";
import AutocompleteItem from "./AutocompleteItem.svelte";
export let suggestionsPromise: Promise<string[]>;
@ -16,6 +17,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
let suggestionsItems: string[] = [];
$: suggestionsPromise.then((items) => {
show.set(items.length > 0);
if (isApplePlatform() && navigator.userAgent.match(/Chrome\/77/)) {
items = items.slice(0, 10);
}
suggestionsItems = items;
});