Fix autocomp behaviour to ignore non-Kannada inputs and always select the first suggestion.

This commit is contained in:
2025-11-30 20:58:27 +05:30
parent acb421a26b
commit 5cfb2d8e6d
3 changed files with 8 additions and 4 deletions

View File

@@ -298,8 +298,12 @@ async function screenshotElement(element) {
});
},
onSelect: (val) => {
// autocomp search isn't complete. Use the user's input instead of autocomp selection.
onSelect: (val, items) => {
// If the val is English, then pick the first item from items and use that.
if (/^[A-Za-z0-9\-,'" ]+$/.test(val) && items.length > 0) {
val = items[0];
}
if (val) {
elQ.value = val;
}