Browse Source

fix: input autofocus on mobile issue

Timothy J. Baek 1 year ago
parent
commit
4a1e506a35
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/lib/components/layout/Sidebar.svelte

+ 6 - 1
src/lib/components/layout/Sidebar.svelte

@@ -35,7 +35,7 @@
 	let isEditing = false;
 
 	onMount(async () => {
-		if (window.innerWidth > 1280) {
+		if (window.innerWidth > 1024) {
 			show = true;
 		}
 		await chats.set(await getChatList(localStorage.token));
@@ -383,6 +383,11 @@
 									? 'bg-gray-900'
 									: ''} transition whitespace-nowrap text-ellipsis"
 								href="/c/{chat.id}"
+								on:click={() => {
+									if (window.innerWidth < 1024) {
+										show = false;
+									}
+								}}
 							>
 								<div class=" flex self-center flex-1 w-full">
 									<div