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

fixing an issue #69

Closed
wants to merge 1 commit into from
Closed

Conversation

learner1024
Copy link

@learner1024 learner1024 commented Jan 21, 2017

In Polymer, if a property is defined as Boolean, then presence of that property in markup will lead to be treated as value true even if value is false, e.g.
<px-vis-axis id="xaxis" prevent-series-bar="false"></px-vis-axis> will still consider it as true.

This happens for same reason, if("false") console.log("true") will be logging "true" on console.

More details can be found here.
Polymer/polymer#1812

one of solution, which I think is minimum impact silver bullet, is to have such properties defined as Object rather than Boolean.

I have made this change for preventSeriesBar for px-vis-axis, as we use that in px-vis-xy-chart and our use case only has one series so not having series bar on y axis would be nice.

I hope this helps

Sandeep Khandewale
(Consultant, GE Oil and Gas, Mumbai)

@nonmetalhail
Copy link
Contributor

Correct. However, this is not a Polymer thing, this is HTML spec and I'm not sure we should stray from the HTML standard. It simply requires default states to be considered in designing the API.

Polymer does make it easy to set booleans to false. Declaratively bound properties will trigger a false boolean and imperatively setting booleans to false works fine.

Although using objects to force computation of the boolean state is clever, I'm concerned with clarity in the documentation. With Boolean properties, it is clear what valid entries are. If the type is object, that is no longer the case.

We'll talk about it and see.

@mdwragg
Copy link
Contributor

mdwragg commented Jan 21, 2017

I agree with @nonmetalhail, not sure about this approach...

@nonmetalhail
Copy link
Contributor

Thinking about this more, I bet that changing the type to Object also break standard Boolean behavior wherein you do not need to provide a value. We definitely dont want to stray from HTML spec in this way.

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

Successfully merging this pull request may close these issues.

3 participants