mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
can add new courses, kinda janky
This commit is contained in:
@@ -7,11 +7,13 @@ export function StoragePathSelector({
|
||||
setValue,
|
||||
label,
|
||||
className,
|
||||
setLastTypedValue,
|
||||
}: {
|
||||
value: string;
|
||||
setValue: (newValue: string) => void;
|
||||
label: string;
|
||||
className?: string;
|
||||
setLastTypedValue?: (value: string) => void;
|
||||
}) {
|
||||
const [path, setPath] = useState(value);
|
||||
const { data: directoryContents } = useDirectoryContentsQuery(value);
|
||||
@@ -25,6 +27,10 @@ export function StoragePathSelector({
|
||||
setPath(value);
|
||||
}, [value]);
|
||||
|
||||
useEffect(() => {
|
||||
if (setLastTypedValue) setLastTypedValue(path);
|
||||
}, [path, setLastTypedValue]);
|
||||
|
||||
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
||||
if (!isFocused || filteredFolders.length === 0) return;
|
||||
if (e.key === "ArrowDown") {
|
||||
|
||||
Reference in New Issue
Block a user