Camel Case properties in SVG's
See original GitHub issueI have a custom element that handles creating SVG elements. In the svg element itself, I bind the view box property and the rest to the element like so:
<svg viewBox="${viewBox}" x="${svgX}" y="${svgY}">...</svg>
Since the update (seemingly related to this particular part about camel case https://github.com/aurelia/binding/commit/315cfaa229c13da8355ee1dec201a09c7df507db) properties that are camel case in the svg (such as viewBox
) no longer display, while other properties like x
and y
display fine.
Also, to further define the problem, it appears that the binding for camel case properties breaks when using string interpolation. For example, this works:
<svg viewBox="0 0 48 48" x="${svgX}" y="${svgY}">...</svg>
while this doesn’t (the viewBox
property does not show in the element):
<svg viewBox="0 0 48 ${svgHeight}" x="${svgX}" y="${svgY}">...</svg>
Another use case is that dropping the .bind
and simply using view-box
as a property works:
<svg view-box="${viewBox}" x="${svgX}" y="${svgY}">...</svg>
This doesn’t seem right, because view-box is not a valid svg property. It seems that the binding engine is taking any property that has a dash in it and converting it to camel case (could be wrong, but it appears to be the case here)
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
@AStoker / @Scapal - there’s a new build of templating-binding and templating-resources available- let me know if you run into any further issues with this release.
@jdanyow Looks like we have a regression here with respect to SVG. Is this going to be easy to address?