Reputation: 2144
I've searched the web extensively for this but cannot find a solution. I have an Ionic app with a page that has a reactive Angular form. I'm only testing on the browser right now, and when I hit enter on that page, it activates my onSubmit()
method.
Is it possible to disable the enter key from submitting the form?
<form [formGroup]="movieListForm" (ngSubmit)="onSubmit()">
</form>
Upvotes: 0
Views: 587
Reputation: 60518
You could try something like this:
<form (keydown.enter)="$event.preventDefault()"></form>
Upvotes: 2