Skip to content
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

When Enter button pressed automatically form is submitted #11

Open
prakash290 opened this issue Oct 26, 2015 · 3 comments
Open

When Enter button pressed automatically form is submitted #11

prakash290 opened this issue Oct 26, 2015 · 3 comments

Comments

@prakash290
Copy link

Hi I Used md-chips directive inside form tag. If Select the value using enter button ng-click event automatically fires. Here sendInmail() function is also executed while select value using enter button how to solve this one?

Here I pasted the HTML form.

md-chips collection='mdchipsFormatedContacts' ng-model='selectedUsers' md-title='title' md-thumbnail='thumbnailUrl' md-subtitle='subtitle' md-item='items' disabled='false' unique='true'"

input type="text" class="form-control" id="inputPassword3" placeholder="Subject" ng-model="composemail.subject"

button class="btn btn-success" ng-click="sendInmail()" Send button

@BogdanRusinka
Copy link
Contributor

Hi, @prakash290. I couldn't reproduce the issue, but you can get the event.target value in your sendMail() function and depending on it you can prevent unnecessary action.

@prakash290
Copy link
Author

Hi @BogdanRusinka . I couldn't get event object inside sendmail(event) function. It is undefined.
This function is present in controller. So i couldn't get event object.

Another Error : While press down key in dropdown

Uncaught TypeError: Cannot read property 'scrollIntoView' of null

@BogdanRusinka
Copy link
Contributor

@prakash290 , event object can be set as a variable to a function. You can do that from html code just passing $event into your function.

In what browser do you get the error? Is it always persistent?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants