New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] IMEがONの場合に変換確定時のEnterで登録されてしまう点の修正 #4

Merged
merged 1 commit into from Jan 28, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+19 −3
Diff settings

Always

Just for now

@@ -1,6 +1,15 @@
<div>
<input type="text" [(ngModel)]="todo.task" (keyup.enter)="add()"
autofocus placeholder="add todo">
<input type="checkbox" [(ngModel)]="todo.done">
<input
type="text"
[(ngModel)]="todo.task"
(keydown)="keyDownCode = $event.which"
(keyup.enter)="handleKeyUp($event)"
autofocus
placeholder="add todo">

<input
type="checkbox"
[(ngModel)]="todo.done">

<button (click)="add()">add</button>
</div>
@@ -10,13 +10,20 @@ export class TodoDetailComponent implements OnInit {

todo: Todo = new Todo;

keyDownCode: number;

@Output() clickAdd = new EventEmitter<Todo>();

constructor() { }

ngOnInit() {
}

handleKeyUp(e: KeyboardEvent) {
if (e.which !== this.keyDownCode) { return; }
this.add();
}

add() {
this.clickAdd.emit(this.todo);
this.todo = new Todo;
ProTip! Use n and p to navigate between commits in a pull request.