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

Case of string values. #12

Open
0rion7st opened this issue Dec 25, 2015 · 3 comments
Open

Case of string values. #12

0rion7st opened this issue Dec 25, 2015 · 3 comments

Comments

@0rion7st
Copy link

In case when value is {"red":"255","green":"255","blue":"255","alpha":"0.5"}
Properties are not Numbers function: _setValueAsHexFromValue works not correct.

Recommended fix:
paper-color-input.html:206
var h = parseInt(value[c]).toString(16);

@David-Mulder
Copy link
Owner

Honestly, why are you setting it to strings in the first place? the parseInt shouldn't happen inside the component, but outside it :/ .

@0rion7st
Copy link
Author

As I said, it's a recommended, I'm using this element in 2 different scenarios, in both this check is "good to have". Anyway even if you don't want to parse. Check with Number.isInteger in order not to produce errors in javascript.

Probably I'll not to fork your repository in order to add additional configuration and bug fixes. I'll try to make some pull request for your judgement.
Thanks for awesome element anyway 👍

@David-Mulder
Copy link
Owner

@0rion7st Well, there are a million other ways developers could give incorrect input as well, so I am not going to check every attribute whether it's valid as that's a waste of runtime.

BUT there is a big bug caused by the lack of a valueAsNumber property on paper-input[type=number] for which I send a PR already weeks ago: PolymerElements/iron-input#68 If that's the problem you're encountering then yeah, I need to somehow fix that in the meantime :/ I was hoping the PR would get pulled quickly, but it's taking ages.

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

No branches or pull requests

2 participants