From 50ec482461e0ab04c1a66319b790c901c17bde95 Mon Sep 17 00:00:00 2001 From: ARRY7686 Date: Mon, 17 Mar 2025 10:02:15 +0530 Subject: [PATCH] Limit completion suggestions to a maximum of five items --- lib/components/Completion.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/components/Completion.ts b/lib/components/Completion.ts index a1a4900..fb548bd 100644 --- a/lib/components/Completion.ts +++ b/lib/components/Completion.ts @@ -113,7 +113,7 @@ export function Completion(editor: HTMLElement): void { suggestionContainer.appendChild(firstDummyChoice); console.log(scoresData); - for (let i = 0; i < scoresData.length; i++) { + for (let i = 0; i < Math.min(scoresData.length,5); i++) { const data = scoresData[i]; const suggestion = document.createElement('button');