Closed handerpeder closed 5 months ago
What in the ... π Well, congratulations on finding the weirdest bug so far. I'll have to dig around a little.
Just to make sure: did you check that this happens without the XML serializer?
Thanks! Yes, happens without the XML serializer.
I'm unable to reproduce this. Do you perhaps have some global CSS, other JavaScript or something else complicating the matter? Here's what I'm seeing:
(require '[replicant.dom :as d])
(do
(set! (.-innerHTML js/document.body) "<div id=\"app\"></div>")
(def el (js/document.getElementById "app"))
(d/render el [:div {:style {:margin "1rem"}} "foo"])
(.-outerHTML el)
) ;;=> "<div id=\"app\"><div style=\"margin: 1rem;\">foo</div></div>"
(do
(set! (.-innerHTML js/document.body) "<div id=\"app\"></div>")
(def el (js/document.getElementById "app"))
(d/render el [:div {:style {:margin-bottom "1rem"}} "foo"])
(.-outerHTML el)
) ;;=> "<div id=\"app\"><div style=\"margin-bottom: 1rem;\">foo</div></div>"
I've set up a repro repo here.
Something in the initial render introduces this, at which point it seems to happen consistently.
This wasn't so surprising after all π Fixed in 3d397ef933972060c98dc73a73df30f10302052c, available as 0.2024.06.30
Using:
no.cjohansen/replicant {:mvn/version "0.2024.05.10"}
Nothing when setting
:margin-bottom
margin-top
,margin-right
andmargin-left
when settingmargin
margin
when settingmargin
andmargin-bottom
seems to also affect padding
Works β
no
padding-bottom
β