瀏覽代碼

fix: confirm dialog input reset on show

Timothy Jaeryang Baek 3 月之前
父節點
當前提交
fb26be7dd6
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      src/lib/components/common/ConfirmDialog.svelte

+ 8 - 0
src/lib/components/common/ConfirmDialog.svelte

@@ -25,11 +25,19 @@
 
 	export let show = false;
 
+	$: if (show) {
+		init();
+	}
+
 	let modalElement = null;
 	let mounted = false;
 
 	let focusTrap: FocusTrap.FocusTrap | null = null;
 
+	const init = () => {
+		inputValue = '';
+	};
+
 	const handleKeyDown = (event: KeyboardEvent) => {
 		if (event.key === 'Escape') {
 			console.log('Escape');