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

:style maps kebab-case to CamelCase automatic conversion only works with literals? #158

Closed
xavi opened this issue Mar 19, 2017 · 4 comments

Comments

@xavi
Copy link

xavi commented Mar 19, 2017

I found this in the context of Rum, which uses Ŝablono, and I was suggested to move it here.

The issue is that when having something like

[:div {:style (merge {:margin-left "2rem"}
                      (when focused? {:color "red"}))}]

The browser shows

Warning: Unsupported style property margin-left. Did you mean marginLeft?

This doesn't happen when the style is a map literal instead of the result of a merge.

Is it a bug?

@r0man
Copy link
Owner

r0man commented Mar 20, 2017

@xavi Yes, that's a bug. I pushed a fix for this. Could you try 0.8.0-SNAPSHOT and report back? Thanks!

@xavi
Copy link
Author

xavi commented Mar 25, 2017

Thanks for the quick response. Unfortunately now I get this error

Uncaught TypeError: Cannot read property 'className' of null
    at sablono$interpreter$attributes (interpreter.cljc:117)
    at Function.<anonymous> (core.cljs:590)
    at Function.cljs.core.apply.cljs$core$IFn$_invoke$arity$2 (core.cljs:3731)
    at cljs$core$apply (core.cljs:3722)
    at render (core.cljs:130)
    at core.cljs:274
    at Object.render (core.cljs:83)
    at react-dom.inc.js:5250
    at measureLifeCyclePerf (react-dom.inc.js:4529)
    at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (react-dom.inc.js:5249)

@r0man
Copy link
Owner

r0man commented Mar 26, 2017

@xavi Thanks for the feedback. I pushed another fix: 1b7a190
Could you try again with the latest 0.8.0-SNAPSHOT? Thanks!

@xavi
Copy link
Author

xavi commented Mar 26, 2017

It worked now :) Thank you!

@xavi xavi closed this as completed Mar 26, 2017
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