diff --git a/network-poc/static/index.html b/network-poc/static/index.html index 08e21f3..8fd1f9a 100644 --- a/network-poc/static/index.html +++ b/network-poc/static/index.html @@ -2645,7 +2645,14 @@ Files: ${Object.keys(generatedFiles).join(', ')}`; } } else if (e.key === 'Tab') { e.preventDefault(); - // Näytä dropdown tai täydennä jos vain yksi vaihtoehto + // 1. Autokorjaus ensin + const corrected = autocorrect(termInput.value.trim()); + if (corrected && corrected !== termInput.value.trim()) { + termInput.value = corrected; + hideDropdown(); + return; + } + // 2. Dropdown / täydennys const { items, prefix } = getCandidates(termInput.value); if (items.length === 1) { termInput.value = prefix + items[0] + (items[0].startsWith('"') ? '' : ' ');