소스 검색

refac: search modal input filters behaviour

Timothy Jaeryang Baek 1 주 전
부모
커밋
5b1f9e3e21
1개의 변경된 파일16개의 추가작업 그리고 5개의 파일을 삭제
  1. 16 5
      src/lib/components/layout/Sidebar/SearchInput.svelte

+ 16 - 5
src/lib/components/layout/Sidebar/SearchInput.svelte

@@ -213,11 +213,14 @@
 			on:input={() => {
 				dispatch('input');
 			}}
-			on:focus={() => {
-				onFocus();
-				hovering = false;
-				focused = true;
-				initTags();
+			on:click={() => {
+				if (!focused) {
+					onFocus();
+					hovering = false;
+
+					focused = true;
+					initTags();
+				}
 			}}
 			on:blur={() => {
 				if (!hovering) {
@@ -260,6 +263,14 @@
 					}
 				} else {
 					// if the user types something, reset to the top selection.
+					if (!focused) {
+						onFocus();
+						hovering = false;
+
+						focused = true;
+						initTags();
+					}
+
 					selectedIdx = 0;
 				}