The new intersperse
component from in Phoenix LiveView is cool, but it adds extra whitespaces that I cannot get rid of.
~H"""
<div id="intersperse">
<.intersperse :let={item} enum={["One", "Two"]}>
<:separator>,</:separator>
<%= item %>
</.intersperse>
</div>
"""
Generated HTML:
The visible output is: One , Two
.
But I would like to have: One, Two
.
Unsuccessful tries
- I tried using
phx-no-format
in the div around - I tried with a
span
around,
andclass="inline-block"
-
class="inline-block"
in span around the item - added a css class with pseudo class
sep:after { content: ",";}
- I even removed the whitespaces in phoenix_live_view/phoenix_component.ex at e67b0e9429e904477a84b6face22dc5da53672c8 · phoenixframework/phoenix_live_view · GitHub and although I could eliminate some, it didn’t help visually. It seems the
for
is adding something somewhere with these slots.
PS: I posted that as an issue on Github Phx/Lv already.