elm / virtual-dom

The foundation of HTML and SVG in Elm.
https://package.elm-lang.org/packages/elm/virtual-dom/latest
BSD 3-Clause "New" or "Revised" License
209 stars 80 forks source link

Add special case to `class` attribute for `Svg.Attributes.class` #94

Closed zwilias closed 7 years ago

zwilias commented 7 years ago

Currently, Html.Attributes.class is special cased so that it can be provided multiple times, and the entries will be appended rather than overwriting one another.

It is rather surprising to the user that this behaves differently when dealing with Svg.

This change is slightly more complicated due to svg requiring the class attribute rather than a property.

Fixes #93

process-bot commented 7 years ago

Thanks for the pull request! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

evancz commented 7 years ago

This will be accounted for in the next release https://github.com/elm-lang/virtual-dom/blob/dev/src/Elm/Kernel/VirtualDom.js#L267-L269

Thanks for the report!