Skip to content

Commit

Permalink
[paper-input] preventing exception when typing with mobile keyboard (#…
Browse files Browse the repository at this point in the history
…551)

test `isDestroyed` before running `setValue`
  • Loading branch information
Juraci authored and miguelcobain committed Nov 8, 2016
1 parent 22c5695 commit 0fb9433
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Contributions and pull requests are always welcome. Contributors may often be fo
### master
- [#542](https://github.com/miguelcobain/ember-paper/pull/542) paper-form now yields a submit button
- [#549](https://github.com/miguelcobain/ember-paper/pull/549) Allow `title` attribute in paper-button
- [#551](https://github.com/miguelcobain/ember-paper/pull/551) avoids calling setValue when the component is destroyed

### 1.0.0-alpha.7 (November 2, 2016)
- [#531](https://github.com/miguelcobain/ember-paper/pull/531) paper-select focus fix - doesn't call focusTarget.focus if there is no focusTarget (which is perfectly possible)
Expand Down
3 changes: 3 additions & 0 deletions addon/components/paper-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ export default Component.extend(FocusableMixin, ColorMixin, ChildMixin, Validati
this.sendAction('onChange', e.target.value);
// setValue below ensures that the input value is the same as this.value
run.next(() => {
if (this.isDestroyed) {
return;
}
this.setValue(this.get('value'));
});
this.growTextarea();
Expand Down

0 comments on commit 0fb9433

Please sign in to comment.