mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-03-04 11:20:53 +01:00
Addition to #2098: only allow search with two or more characters
This commit is contained in:
@@ -210,16 +210,18 @@ const useKeyBoardNavigation = (
|
||||
});
|
||||
break;
|
||||
case 13: // e.code: Enter
|
||||
if (index < 0) {
|
||||
history.push(defaultLink);
|
||||
} else {
|
||||
const entry = entries[index];
|
||||
if (entry?.props.link) {
|
||||
history.push(entry.props.link);
|
||||
if ((e.target as HTMLInputElement).value.length >= 2) {
|
||||
if (index < 0) {
|
||||
history.push(defaultLink);
|
||||
} else {
|
||||
const entry = entries[index];
|
||||
if (entry?.props.link) {
|
||||
history.push(entry.props.link);
|
||||
}
|
||||
}
|
||||
clear();
|
||||
hideResults();
|
||||
}
|
||||
clear();
|
||||
hideResults();
|
||||
|
||||
break;
|
||||
case 27: // e.code: Escape
|
||||
|
||||
Reference in New Issue
Block a user