You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello Phoenix Team 👋
This is a minor issue with the input component from the core_components.ex file (used in phx.gen.live)
A margin top is added by default for the spacing between the label and the input.
However it is not removed if a label is not provided. Which causes alignment issue when combining the input component with other elements on our UI.
Of course this can be fixed easily by modifying the core_component in my project but I guess this can be a quick win improvement to update the core_components.ex directly in Phoenix. I can propose a PR if you think it's worth making a small update 🙏
Expected behavior
Avoid adding a margin to the input if a label is not provided to the input component.
Fix: one idea could be to put the mt-2 class behind a condition, e.g:
NTurchi
changed the title
Remove margin top on the input component if no label is provided in core_component.ex
Remove margin top on the input component if no label is provided in core_components.exJun 4, 2024
Environment
1.7.12
Actual behavior
Hello Phoenix Team 👋
This is a minor issue with the input component from the
core_components.ex
file (used inphx.gen.live
)A margin top is added by default for the spacing between the label and the input.
phoenix/priv/templates/phx.gen.live/core_components.ex
Lines 357 to 361 in 69685f7
However it is not removed if a label is not provided. Which causes alignment issue when combining the input component with other elements on our UI.
Of course this can be fixed easily by modifying the
core_component
in my project but I guess this can be a quick win improvement to update thecore_components.ex
directly in Phoenix. I can propose a PR if you think it's worth making a small update 🙏Expected behavior
Avoid adding a margin to the input if a
label
is not provided to the input component.Fix: one idea could be to put the
mt-2
class behind a condition, e.g:The text was updated successfully, but these errors were encountered: