@agilant/toga-blox 1.0.61 → 1.0.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,7 +14,7 @@ const SearchTextInput = ({ pillColor = "bg-sky-500", textHighlight = "text-sky-5
|
|
|
14
14
|
const containerRef = useRef(null);
|
|
15
15
|
const [localSearchText, setLocalSearchText] = useState("");
|
|
16
16
|
const inputRef = useRef(null);
|
|
17
|
-
//
|
|
17
|
+
// Focus on mount and load persisted search criteria for this column.
|
|
18
18
|
useEffect(() => {
|
|
19
19
|
inputRef.current?.focus();
|
|
20
20
|
const stored = localStorage.getItem(localStorageKey);
|
|
@@ -31,7 +31,6 @@ const SearchTextInput = ({ pillColor = "bg-sky-500", textHighlight = "text-sky-5
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}, [column.id, localStorageKey]);
|
|
34
|
-
// Helper to update local storage using the dynamic key
|
|
35
34
|
const updateLocalStorage = (criteria) => {
|
|
36
35
|
localStorage.setItem(localStorageKey, JSON.stringify(criteria));
|
|
37
36
|
};
|
|
@@ -39,7 +38,6 @@ const SearchTextInput = ({ pillColor = "bg-sky-500", textHighlight = "text-sky-5
|
|
|
39
38
|
setLocalSearchText(event.target.value);
|
|
40
39
|
};
|
|
41
40
|
const handleSearchBadgeClick = (item) => {
|
|
42
|
-
// Remove criterion
|
|
43
41
|
const filteredItems = searchItems.filter((ele) => ele !== item);
|
|
44
42
|
setSearchItems && setSearchItems(filteredItems);
|
|
45
43
|
};
|
|
@@ -74,10 +72,7 @@ const SearchTextInput = ({ pillColor = "bg-sky-500", textHighlight = "text-sky-5
|
|
|
74
72
|
else {
|
|
75
73
|
updated = [
|
|
76
74
|
...prev,
|
|
77
|
-
{
|
|
78
|
-
searchColumn: column,
|
|
79
|
-
submittedSearchText: trimmed,
|
|
80
|
-
},
|
|
75
|
+
{ searchColumn: column, submittedSearchText: trimmed },
|
|
81
76
|
];
|
|
82
77
|
}
|
|
83
78
|
updateLocalStorage(updated);
|