Open
Description
When attempting to add a class name to an SVG element using class
from the elm-lang/html
package the compiler doesn't complain. When running the compiled program an error is thrown:
Uncaught TypeError: Cannot set property className of #<SVGElement> which has only a getter
It's a stupid mistake, but still, when working with some SVG content nested in an HTML view it's not unlikely to happen.
Below is a sample program that produces the error.
module Main exposing (..)
import Html.App as Html
import Svg exposing (..)
import Html.Attributes exposing (class)
view : () -> Svg Never
view model =
svg []
[ g [ class "html-class" ]
[]
]
main : Program Never
main =
Html.beginnerProgram { model = (), view = view, update = \_ _ -> () }
Metadata
Metadata
Assignees
Labels
No labels