Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paper-checkbox when value goes from true to undefined, shows "selected" background, but without the checkmark #140

Open
1 of 8 tasks
jamesmgg opened this issue Jul 18, 2016 · 4 comments

Comments

@jamesmgg
Copy link

jamesmgg commented Jul 18, 2016

Description

paper-checkbox when set to true, and then set to undefined, shows unexpected behavior -- the checkmark disappears, but the "checked" background stays

Expected outcome

Both checkmark and "checked" background should disappear when checked != true

Actual outcome

paper-checkbox when checked set to undefined (when it previously was set to true), shows blue background without checkmark

Live Demo

Sorry, just want to do a quick report.

Steps to reproduce

Put a paper-checkbox with an attribute set to true:
// scope = {publicProfile:true}
<paper-checkbox checked$="{{scope.publicProfile}}"></paper-checkbox>

then set scope to empty to make publicProfile undefined
this.set("scope", {})

you should now see the unexpected behavior.

Do note that using checked$ instead of checked fixes the issue:
<paper-checkbox checked$="{{scope.publicProfile}}">

Browsers Affected

  • Chrome
  • Firefox
  • Safari 9
  • Safari 8
  • Safari 7
  • Edge
  • IE 11
  • IE 10
    (Haven't tested on other browsers, but same issue should apply)
@bicknellr
Copy link
Contributor

bicknellr commented Jul 18, 2016

example with bug: http://jsbin.com/ledupa/1/edit?html,output

@bicknellr
Copy link
Contributor

I think this has to do with multi-property observers not firing when their dependencies change to undefined: https://github.com/PolymerElements/paper-checkbox/blob/master/paper-checkbox.html#L227.

@dwberry
Copy link

dwberry commented Sep 28, 2016

Any resolution?

@mgiuffrida
Copy link
Contributor

Updated repro case that specifies version 1.x: https://jsfiddle.net/yhjcu8hg/

Steps to repro: Press true, then undefined

Result: checkbox shows no checkmark but blue background

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants