fix(grid): Enter 键优先选中自动补全建议项 (closes #202)

WHERE 和 ORDER BY 输入框中,有自动补全建议显示时按 Enter 键
现在会选中当前高亮的建议项,而不是直接执行查询。
This commit is contained in:
t8y2
2026-05-11 11:00:02 +08:00
parent 22453f9097
commit 9413df686e
4 changed files with 40 additions and 2 deletions
+8
View File
@@ -623,6 +623,10 @@ function onWhereFilterKeydown(e: KeyboardEvent) {
}
if (e.key === "Enter") {
e.preventDefault();
if (whereSuggestions.value.length > 0) {
acceptWhereSuggestion();
return;
}
applyWhereFilter();
}
}
@@ -709,6 +713,10 @@ function onOrderByKeydown(e: KeyboardEvent) {
}
if (e.key === "Enter") {
e.preventDefault();
if (orderBySuggestions.value.length > 0) {
acceptOrderBySuggestion();
return;
}
applyOrderBySearch();
}
}