We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c062e5 commit 474710eCopy full SHA for 474710e
src/components/TodoForm.ts
@@ -13,7 +13,7 @@ export default class TodoForm {
13
14
private render() {
15
this.$form.innerHTML = `
16
- <input type="text" placeholder="할 일을 입력하세요" name="todo" />
+ <input type="text" placeholder="할 일을 입력하세요" name="todo" minLength="2" autocomplete="off" />
17
<button>추가</button>
18
`;
19
@@ -24,10 +24,8 @@ export default class TodoForm {
24
const $todo = this.$form.querySelector<HTMLInputElement>("input[name=todo]");
25
if (!$todo) return;
26
const text = $todo.value;
27
- if (text.length > 1) {
28
- $todo.value = "";
29
- this.onSubmit(text);
30
- } else alert("두 글자 이상 입력해주세요");
+ $todo.value = "";
+ this.onSubmit(text);
31
});
32
};
33
}
0 commit comments