Skip to content

Commit

Permalink
PolymerElements#170 Ensure checked has a default value of false if no…
Browse files Browse the repository at this point in the history
…t set

There is a known bug where when checked is bound to in a template value it's default value when unset is 'undefined' which results in the essential _compute functions not being called. Thus the hidden class (most importantly) is not defined and the default checkbox remains visible within the paper-checkbox location resulting in very bad UX.

This is probably a very inefficient method but.... it works. And doesn't loop so it's a start at least. And because it doesn't rely on passing itself into a computed function, it is still called when it's undefined and thus solves the primary problem indicated in PolymerElements#170
  • Loading branch information
azariah001 authored Feb 28, 2017
1 parent 597add1 commit 864fed0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions paper-checkbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,17 @@
ariaActiveAttribute: {
type: String,
value: 'aria-checked'
},

/**
* @attribute checked
* @type Boolean
*/
checked: {
type: Boolean,
value: function() {
this.checked = this.checked | false;
}
}
},

Expand Down

0 comments on commit 864fed0

Please sign in to comment.