Skip to content

Commit

Permalink
Add focus and blur to mm-input
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonykoerber committed Apr 21, 2016
1 parent e0adfc4 commit 3903683
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/mm-input/mm-input.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<link rel="import" type="css" href="mm-input.css"/>
<template>
<input
id="input"
type="{{type}}"
class$="{{ _updateClass(direction, error) }}"
placeholder="{{placeholder}}"
Expand Down
9 changes: 9 additions & 0 deletions src/mm-input/mm-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,15 @@
this.fire("changed", { value: newVal });
},

setFocus: function() {
this.$.input.focus();
// this.$.input.select();
},

setBlur: function() {
this.$.input.blur();
},

clearInput: function(e) {
this.value = null;
this._clearVisible = false;
Expand Down

0 comments on commit 3903683

Please sign in to comment.