Merge pull request #993 from RooVetGit/welcome_submit_delay

Add delay on submitting from welcome view
This commit is contained in:
Matt Rubens 2025-02-14 09:59:03 -05:00 committed by GitHub
commit e8c799bb26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,7 +10,13 @@ const WelcomeView = () => {
const [errorMessage, setErrorMessage] = useState<string | undefined>(undefined)
const handleSubmit = () => {
const handleSubmit = async () => {
// Focus the active element's parent to trigger blur
document.activeElement?.parentElement?.focus()
// Small delay to let blur events complete
await new Promise((resolve) => setTimeout(resolve, 50))
const error = validateApiConfiguration(apiConfiguration)
if (error) {
setErrorMessage(error)