fix: blur input on mobile after submit, focus on desktop

This commit is contained in:
Andrew Beal 2025-11-12 00:06:54 +00:00
parent 0556ae984a
commit ada7f358ef
2 changed files with 7 additions and 3 deletions

View file

@ -1,6 +1,6 @@
<script lang="ts">
import { tick } from "svelte";
import { setIcon } from "obsidian";
import { Platform, setIcon } from "obsidian";
import type { UserInputService } from "Services/UserInputService";
import type { ISearchState, SearchStateStore } from "Stores/SearchStateStore";
import { Resolve } from "Services/DependencyService";
@ -65,6 +65,12 @@
textareaElement.textContent = "";
userRequest = "";
if (Platform.isMobile) {
textareaElement.blur();
} else {
focusInput();
}
onsubmit(request, formattedRequest);
}

View file

@ -90,8 +90,6 @@
}
async function handleSubmit(userRequest: string, formattedRequest: string) {
focusInput();
if (handleNoApiKey()) {
return;
}