mirror of
https://github.com/andy-stack/vaultkeeper-ai.git
synced 2026-07-22 06:42:03 +00:00
fix: blur input on mobile after submit, focus on desktop
This commit is contained in:
parent
0556ae984a
commit
ada7f358ef
2 changed files with 7 additions and 3 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -90,8 +90,6 @@
|
|||
}
|
||||
|
||||
async function handleSubmit(userRequest: string, formattedRequest: string) {
|
||||
focusInput();
|
||||
|
||||
if (handleNoApiKey()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue