ember-cli-materialize icon indicating copy to clipboard operation
ember-cli-materialize copied to clipboard

How to add action on enter for md-input?

Open floqqi opened this issue 10 years ago • 2 comments

How do I add an action for key-press (e. g. enter) on md-input component?

floqqi avatar Sep 09 '15 16:09 floqqi

You can catch an enter key-press in a component using:

keyPress: function(e) {
    if(e.which === 13) {
        //Do Something here...
    }
},

You will probably need to extend the input component.

Hope that helps.

lukeclewlow avatar Sep 10 '15 10:09 lukeclewlow

Thanks, that works for me. But shouldn't there be a more semantic way like a parameter for the md-input-component?

floqqi avatar Sep 10 '15 15:09 floqqi