diff --git a/comps/ui/typeahead-opt.tsx b/comps/ui/typeahead-opt.tsx
index b6645ad..9e9a316 100755
--- a/comps/ui/typeahead-opt.tsx
+++ b/comps/ui/typeahead-opt.tsx
@@ -18,6 +18,7 @@ export const TypeaheadOptions: FC<{
}) => boolean;
onSelect?: (value: string) => void;
searching?: boolean;
+ searchText?: string;
width?: number;
}> = ({
popup,
@@ -29,6 +30,7 @@ export const TypeaheadOptions: FC<{
selected,
onSelect,
searching,
+ searchText,
showEmpty,
width,
}) => {
@@ -87,7 +89,22 @@ export const TypeaheadOptions: FC<{
<>
{options.length === 0 && (
- — Empty —
+ {!searchText ? (
+ <>— Empty —>
+ ) : (
+ <>
+ Search
+
+ "{searchText}"
+
+ not found
+ >
+ )}
)}
>
diff --git a/comps/ui/typeahead.tsx b/comps/ui/typeahead.tsx
index d51aea8..350ee58 100755
--- a/comps/ui/typeahead.tsx
+++ b/comps/ui/typeahead.tsx
@@ -213,6 +213,8 @@ export const Typeahead: FC<{
local.open = true;
if (e.key === "ArrowDown") {
e.preventDefault();
+ e.stopPropagation();
+
const idx = options.findIndex((item) => {
if (item.value === local.select?.value) return true;
});
@@ -229,6 +231,7 @@ export const Typeahead: FC<{
}
if (e.key === "ArrowUp") {
e.preventDefault();
+ e.stopPropagation();
const idx = options.findIndex((item) => {
if (item.value === local.select?.value) return true;
@@ -392,6 +395,7 @@ export const Typeahead: FC<{
open={local.open}
options={options}
searching={local.search.searching}
+ searchText={local.search.input}
onSelect={(value) => {
local.open = false;
resetSearch();