paper-checkbox
paper-checkbox copied to clipboard
Consider styling using CSS and not a computed class, to get around weird UI bug when checked='null'
I have an object from firebase-document with booleans inside it and am using two way databinding to update them. If the object changes the checkmark and its value change accordingly but the background-color of the checkbox is never changed.
I think there's something incorrect in your setup. Here's a JSBin with a bunch of two-way-binded items, and the checkbox selects and deselects correctly: http://jsbin.com/lahoyi/edit?html,output.
Going to close this since I can't repro, but please re-open if you can provide an actual example where this is broken and that we can debug :(
@notwaldorf Try this one, put a
into the input, then try b
, then c
then d
http://output.jsbin.com/huwesenilo/
It looks ok?
Interesting, but if i type 'bb' I see what you mean. Hmm.
It's the only element that seems to do this, and I've run into it in multiple projects, all related to the firebase objects though being hotswapped out
When I type bb
, _computeCheckboxClass: function(checked, invalid)
isn't called, which means that checked
doesn't actually change. What does object.checked3
actually return? Is it undefined
by any chance?
(as in: when I'm debugging, it seems that when I type bb
in your demo, checked
is set to undefined, which makes sense why the _computeCheckboxClass
method isn't called).
This doesn't happen for toggle or radio button because the way the change their css is different.
Yeah, it returns null
I think, or is just not defined, which probably doesn't kick off the computed property...
@notwaldorf Should this be reopened or is it not a bug?
I don't think it's really a bug, since it looks like you're using the attribute incorrectly (setting checked='undefined'
is not correct).
But I do agree that maybe we should, for consistency, style in css using attributes vs. using a computed class, which would at least make the element consistent with the radio-button, for example.
I'll re-open and retitle