Skip to content

Commit

Permalink
Don't depend on Phoenix.HTML.Form.textarea
Browse files Browse the repository at this point in the history
  • Loading branch information
angelikatyborska committed Jul 17, 2024
1 parent 3dc2cbb commit 7ee8b51
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/bitstyles_phoenix/component/form.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ defmodule BitstylesPhoenix.Component.Form do
use BitstylesPhoenix.Component

import BitstylesPhoenix.Component.Error
alias Phoenix.HTML.Form, as: PhxForm

@moduledoc """
Components for rendering input elements.
Expand Down Expand Up @@ -503,7 +502,7 @@ defmodule BitstylesPhoenix.Component.Form do
)

def ui_textarea(assigns) do
extra = assigns_to_attributes(assigns, @wrapper_assigns_keys)
extra = assigns_to_attributes(assigns, @wrapper_assigns_keys ++ [:type])

assigns =
assigns
Expand All @@ -512,7 +511,7 @@ defmodule BitstylesPhoenix.Component.Form do

~H"""
<.ui_unwrapped_input {@wrapper}>
<%= PhxForm.textarea(@form, @field, @extra) %>
<%= render_input(:textarea, @form, @field, @extra) %>
</.ui_unwrapped_input>
"""
end
Expand Down Expand Up @@ -900,7 +899,7 @@ defmodule BitstylesPhoenix.Component.Form do
end

def input(%{type: "textarea"} = assigns) do
extra = assigns_to_attributes(assigns, [:id, :name])
extra = assigns_to_attributes(assigns, [:id, :name, :type, :value])
assigns = assign(assigns, extra: extra)

~H"""
Expand Down

0 comments on commit 7ee8b51

Please sign in to comment.