fix: discover form button disable state error (#2113)

This commit is contained in:
X
2024-12-12 11:16:17 +08:00
committed by GitHub
parent 0eed6d1b23
commit 0ae6ec954a
+1 -1
View File
@@ -123,7 +123,7 @@ export function DiscoverForm({ type = "search" }: { type?: string }) {
(event: ChangeEvent<HTMLInputElement>) => {
const trimmedKeyword = event.target.value.trimStart()
if (!prefix) {
form.setValue("keyword", trimmedKeyword)
form.setValue("keyword", trimmedKeyword, { shouldValidate: true })
return
}
const isValidPrefix = prefix.find((p) => trimmedKeyword.startsWith(p))