mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-30 08:20:33 +00:00
fix(grid): Enter 键优先选中自动补全建议项 (closes #202)
WHERE 和 ORDER BY 输入框中,有自动补全建议显示时按 Enter 键 现在会选中当前高亮的建议项,而不是直接执行查询。
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user