forked from Github/frigate
UI changes and bugfixes (#14669)
* Home/End buttons for search input and max 8 search columns * Fix lifecycle label * remove video tab if tracked object has no clip * hide object lifecycle if there is no clip * add test for filter value to ensure only fully numeric values are set as numbers
This commit is contained in:
@@ -523,17 +523,29 @@ export default function InputWithTags({
|
||||
|
||||
const handleInputKeyDown = useCallback(
|
||||
(e: React.KeyboardEvent<HTMLInputElement>) => {
|
||||
const event = e.target as HTMLInputElement;
|
||||
|
||||
if (!currentFilterType && (e.key === "Home" || e.key === "End")) {
|
||||
const position = e.key === "Home" ? 0 : event.value.length;
|
||||
event.setSelectionRange(position, position);
|
||||
}
|
||||
|
||||
if (
|
||||
e.key === "Enter" &&
|
||||
inputValue.trim() !== "" &&
|
||||
filterSuggestions(suggestions).length == 0
|
||||
) {
|
||||
e.preventDefault();
|
||||
|
||||
handleSearch(inputValue);
|
||||
}
|
||||
},
|
||||
[inputValue, handleSearch, filterSuggestions, suggestions],
|
||||
[
|
||||
inputValue,
|
||||
handleSearch,
|
||||
filterSuggestions,
|
||||
suggestions,
|
||||
currentFilterType,
|
||||
],
|
||||
);
|
||||
|
||||
// effects
|
||||
|
||||
Reference in New Issue
Block a user