Skip to content

Commit

Permalink
fix changing paper-input value to empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelcobain committed Dec 4, 2018
1 parent 683aba7 commit 9503337
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion addon/components/paper-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ export default Component.extend(FocusableMixin, ColorMixin, ChildMixin, Validati
},

setValue(value) {
if (this.element.querySelector('input, textarea').value !== value && value) {
// normalize falsy values to empty string
value = isEmpty(value) ? '' : value;

if (this.element.querySelector('input, textarea').value !== value) {
this.element.querySelector('input, textarea').value = value;
}
},
Expand Down

0 comments on commit 9503337

Please sign in to comment.