Tab-autokorjaus: korjattu ohitettu autocorrect Tab-handlerissa
Tab-painallus meni suoraan dropdown-getCandidatesiin eikä kutsunut autocorrectiä. Nyt Tab yrittää ensin korjata typon, sitten täydentää. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2645,7 +2645,14 @@ Files: ${Object.keys(generatedFiles).join(', ')}`;
|
|||||||
}
|
}
|
||||||
} else if (e.key === 'Tab') {
|
} else if (e.key === 'Tab') {
|
||||||
e.preventDefault();
|
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);
|
const { items, prefix } = getCandidates(termInput.value);
|
||||||
if (items.length === 1) {
|
if (items.length === 1) {
|
||||||
termInput.value = prefix + items[0] + (items[0].startsWith('"') ? '' : ' ');
|
termInput.value = prefix + items[0] + (items[0].startsWith('"') ? '' : ' ');
|
||||||
|
|||||||
Reference in New Issue
Block a user