fix: Make styled inputs work correctly
This commit is contained in:
parent
75e1422708
commit
6937fd5365
1 changed files with 2 additions and 2 deletions
|
@ -48,7 +48,7 @@ defmodule Legendary.CoreWeb.Helpers do
|
|||
{type, rest_opts} = Keyword.pop(opts, :type, input_type(f, field))
|
||||
{classes, rest_opts} = Keyword.pop(rest_opts, :class, default_classes_for_type(type))
|
||||
{label_text, rest_opts} = Keyword.pop(rest_opts, :label)
|
||||
{input_helper, _rest_opts} = Keyword.pop(rest_opts, :input_helper, type)
|
||||
{input_helper, _rest_opts} = Keyword.pop(rest_opts, :input_helper, input_type(f, field))
|
||||
|
||||
error_classes =
|
||||
if Keyword.get_values(f.errors, field) |> Enum.any?() do
|
||||
|
@ -103,7 +103,7 @@ defmodule Legendary.CoreWeb.Helpers do
|
|||
|
||||
~E"""
|
||||
<%= content_tag :div, class: Enum.join([classes, error_classes], " ") do %>
|
||||
<%= apply(Phoenix.HTML.Form, input_helper, [f, field, rest_opts ++ child_opts]) %>
|
||||
<%= apply(Phoenix.HTML.Form, type, [f, field, rest_opts ++ child_opts]) %>
|
||||
<% end %>
|
||||
"""
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue