Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

destructure onEmptySubmit

Steven Tey94458740d818
diff --git a/packages/ui/src/filter/filter-select.tsx b/packages/ui/src/filter/filter-select.tsx
index 692bc9ab3d..6994614c21 100644
--- a/packages/ui/src/filter/filter-select.tsx
+++ b/packages/ui/src/filter/filter-select.tsx
@@ -189,7 +189,7 @@ export function FilterSelect({
selectedFilterKey ? reset() : setIsOpen(false);
}
}}
- emptysubmit={(e) => {
+ onEmptySubmit={(e) => {
e.preventDefault();
e.stopPropagation();
if (askAI) {
@@ -326,20 +326,21 @@ function isEmptyStateObject(
const CommandInput = (
props: React.ComponentProps<typeof Command.Input> & {
- emptysubmit?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
+ onEmptySubmit?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
},
) => {
+ const { onEmptySubmit, ...restProps } = props;
const isEmpty = useCommandState((state) => state.filtered.count === 0);
return (
<Command.Input
- {...props}
+ {...restProps}
size={1}
className="grow border-0 py-3 pl-4 pr-2 outline-none placeholder:text-neutral-400 focus:ring-0 sm:text-sm"
onKeyDown={(e) => {
props.onKeyDown?.(e);
if (e.key === "Enter" && isEmpty) {
- props.emptysubmit?.(e);
+ onEmptySubmit?.(e);
}
}}
autoCapitalize="none"