Skip to content

pressing enter key when input is focused 'clicks' first button on form #12643

@thewizarodofoz

Description

@thewizarodofoz

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

I have a form element with several inputs and buttons in it.
When an input is focused and I press the Enter key, the first button on the form is being clicked.
Expected behavior

Pressing Enter should not click the first button.
Minimal reproduction of the problem with instructions

http://plnkr.co/edit/0wQt4KTGL4cDsh3zeZ88?p=preview
What is the motivation / use case for changing the behavior?

In my form I have something like a 'chips' component, which allows adding token by pressing Enter on an input field.
Please tell us about your environment:

Mac, Webstorm, Webpack, Node

  • Angular version: 2.1.2
  • Browser:
    Chrome, Firefox, Safari (all latest)
  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    TypeScript 2.0.6
  • Node (for AoT issues): node --version =

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions