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

background-color should be valid input #667

Closed
intentionally-left-nil opened this issue Apr 11, 2016 · 3 comments
Closed

background-color should be valid input #667

intentionally-left-nil opened this issue Apr 11, 2016 · 3 comments

Comments

@intentionally-left-nil
Copy link
Contributor

Repro is trivial: Just try to queue up a velocity animation to change the background-color to #000. It will fail. However, passing in backgroundColor succeeds.

Most of the code is set up to allow animating both background-color and backgroundColor but a small section of code in the start handler is missing this normalization code. This causes the code to fail to append the Red, Green and Blue styles. This cascades as a problem in Css.Values.getUnitType which now defaults to px because it fails the following regex below:

getUnitType: function (property) {
                if (/^(rotate|skew)/i.test(property)) {
                    return "deg";
                } else if (/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(property)) {
                    /* The above properties are unitless. */
                    return "";
                } else {
                    /* Default to px for all other properties. */
                    return "px";
                }
            },

The fix is to add CSS.Names.camelCase somewhere to the init codepath. I have created a motivating PR here to better describe the issue.

Thanks!

@Rycochet
Copy link
Collaborator

I think this sort of thing should be checked globally - follow Angular2's example and accept either version in all places it can happen (this is a good case for unit tests) ;-)

@Rycochet Rycochet added this to the 2.0.0 milestone Aug 13, 2016
@Rycochet Rycochet removed this from the 2.0.0 milestone Sep 20, 2016
@Rycochet
Copy link
Collaborator

Rycochet commented Oct 9, 2016

Fixed by 5b7ec85 - all property values are camelCase before playing with them now.

@Rycochet Rycochet closed this as completed Oct 9, 2016
@intentionally-left-nil
Copy link
Contributor Author

Thank you!!! 🎉 🎊 🎉 🌮

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

2 participants