diff --git a/apps/roam/src/components/FuzzySelectInput.tsx b/apps/roam/src/components/FuzzySelectInput.tsx index 2cfe27686..caf88df8d 100644 --- a/apps/roam/src/components/FuzzySelectInput.tsx +++ b/apps/roam/src/components/FuzzySelectInput.tsx @@ -8,7 +8,6 @@ import React, { import { Button, TextArea, - InputGroup, Menu, MenuItem, Popover, @@ -18,6 +17,7 @@ import fuzzy from "fuzzy"; import { Result } from "~/utils/types"; const RESULTS_LIMIT = 50; +const MAX_CONTENT_LENGTH = 512; type FuzzySelectInputProps = { value?: T; @@ -44,7 +44,7 @@ const FuzzySelectInput = ({ const [isFocused, setIsFocused] = useState(false); const menuRef = useRef(null); - const inputRef = useRef(null); + const inputRef = useRef(null); const filteredItems = useMemo(() => { if (!query) return options; @@ -86,7 +86,7 @@ const FuzzySelectInput = ({ ); const handleKeyDown = useCallback( - (e: React.KeyboardEvent) => { + (e: React.KeyboardEvent) => { if (e.key === "ArrowDown") { e.preventDefault(); setActiveIndex((prev) => @@ -158,17 +158,26 @@ const FuzzySelectInput = ({ }, [autoFocus, mode, isLocked]); if (mode === "edit") { + const editText = value?.text || ""; return ( -