From 6937fd5365edf23646702a1575544c578e7a93e4 Mon Sep 17 00:00:00 2001 From: Robert Prehn Date: Fri, 17 Sep 2021 11:42:20 -0500 Subject: [PATCH] fix: Make styled inputs work correctly --- apps/core/lib/core_web/views/helpers.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/core/lib/core_web/views/helpers.ex b/apps/core/lib/core_web/views/helpers.ex index cfed1753..54191d60 100644 --- a/apps/core/lib/core_web/views/helpers.ex +++ b/apps/core/lib/core_web/views/helpers.ex @@ -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