Skip to content

Commit 1e9312b

Browse files
Merge pull request #19 from abhitrueprogrammer/master
Fixed upload command box
2 parents 8bb5daf + 583e0a4 commit 1e9312b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/app/upload/page.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ const Page = () => {
3939
const [exam, setExam] = useState("");
4040
const [year, setYear] = useState("");
4141
const [files, setFiles] = useState<File[]>([]);
42+
const [inputValue, setInputValue] = useState('')
43+
4244
const [isSubjectCommandOpen, setIsSubjectCommandOpen] = useState(false);
4345
// const toggleOpenCamera = () => {
4446
// setOpenCamera((prev) => !prev);
@@ -112,6 +114,7 @@ const Page = () => {
112114

113115
const handleSubjectSelect = (value: string) => {
114116
setSubject(value);
117+
setInputValue(value)
115118
setIsSubjectCommandOpen(false);
116119
};
117120

@@ -191,7 +194,10 @@ const Page = () => {
191194
)}
192195
</div> */}
193196
<Command className="rounded-lg border shadow-md md:min-w-[450px]">
194-
<CommandInput placeholder="Type a subject or search..." />
197+
<CommandInput
198+
value={inputValue}
199+
onChangeCapture={(e) => setInputValue((e.target as HTMLInputElement).value)}
200+
placeholder="Type a subject or search..." />
195201
<CommandList className="h-[100px]">
196202
<CommandEmpty>No results found.</CommandEmpty>
197203

0 commit comments

Comments
 (0)