Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Default value for "checked" is undefined, this causes a bug #170

Open
ellenaua opened this issue Jan 30, 2017 · 2 comments
Open

Default value for "checked" is undefined, this causes a bug #170

ellenaua opened this issue Jan 30, 2017 · 2 comments

Comments

@ellenaua
Copy link

ellenaua commented Jan 30, 2017

Description

Default value for "checked" attribute is undefined, but documentation says it's "false".
This is important, because when checked=undefined, and invalid=true, this function
https://github.com/PolymerElements/paper-checkbox/blob/master/paper-checkbox.html#L230
is not called and .invalid class is not set on the checkbox.

Expected outcome

Default value for checked attribute should be false
When I set invalid to true, checkbox should get .invalid class.

Actual outcome

Default value for checked attribute is undefined
When I set invalid to true, checkbox does not get .invalid class.

@ellenaua ellenaua changed the title Default value for checked is undefined, not false Default value for "checked" is undefined, this causes a bug Jan 30, 2017
azariah001 added a commit to azariah001/paper-checkbox that referenced this issue Feb 28, 2017
…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
@azariah001
Copy link

I've made a hack patch for this problem. If someone could take a look at it and maybe suggest a more efficient way of achieving the same effect that would be brilliant. Holding off on a pull request just yet.

@Igor-Vladyka
Copy link

Problem resolved in #172

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

No branches or pull requests

3 participants