ソースを参照

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;
 				}