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

Inline style on cell violates csp #121

Open
BryanCrotaz opened this issue Jul 7, 2016 · 2 comments
Open

Inline style on cell violates csp #121

BryanCrotaz opened this issue Jul 7, 2016 · 2 comments

Comments

@BryanCrotaz
Copy link

// addon/components/ember-collection/template.hbs
...
{{~#each _cells as |cell|~}}
    <div style={{{cell.style}}}>{{yield cell.item cell.index }}</div>
{{~/each~}}
...

What's a good way to apply the style using js? I've done this successfully in ember-cli-csp-style but that only works on the root element. Can't use a helper as it doesn't know its target context.

Happy to write a PR for this if someone more familiar with Glimmer can hint at a good way to solve.

@krisselden
Copy link
Contributor

It's because it is using a path that goes through setAttribute which then uses the CSS parser, if it did style prop of the element that would work. This though would need to expose the current element modifier API which isn't public or become a component.

@BryanCrotaz
Copy link
Author

I've refactored as a component - getting it working in a fork then submitting a PR

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