Add optional class attribute to textarea
This commit is contained in:
@ -261,6 +261,7 @@ defmodule OutlookWeb.CoreComponents do
|
|||||||
attr :multiple, :boolean, default: false, doc: "the multiple flag for select inputs"
|
attr :multiple, :boolean, default: false, doc: "the multiple flag for select inputs"
|
||||||
attr :rest, :global, include: ~w(autocomplete disabled form max maxlength min minlength
|
attr :rest, :global, include: ~w(autocomplete disabled form max maxlength min minlength
|
||||||
pattern placeholder readonly required size step)
|
pattern placeholder readonly required size step)
|
||||||
|
attr :class, :string, default: "", doc: "optional additional classes"
|
||||||
slot :inner_block
|
slot :inner_block
|
||||||
|
|
||||||
def input(%{field: {f, field}} = assigns) do
|
def input(%{field: {f, field}} = assigns) do
|
||||||
@ -326,7 +327,8 @@ defmodule OutlookWeb.CoreComponents do
|
|||||||
input_border(@errors),
|
input_border(@errors),
|
||||||
"mt-2 block min-h-[6rem] w-full rounded-lg border-zinc-300 py-[7px] px-[11px]",
|
"mt-2 block min-h-[6rem] w-full rounded-lg border-zinc-300 py-[7px] px-[11px]",
|
||||||
"text-zinc-900 focus:border-zinc-400 focus:outline-none focus:ring-4 focus:ring-zinc-800/5 sm:text-sm sm:leading-6",
|
"text-zinc-900 focus:border-zinc-400 focus:outline-none focus:ring-4 focus:ring-zinc-800/5 sm:text-sm sm:leading-6",
|
||||||
"phx-no-feedback:border-zinc-300 phx-no-feedback:focus:border-zinc-400 phx-no-feedback:focus:ring-zinc-800/5"
|
"phx-no-feedback:border-zinc-300 phx-no-feedback:focus:border-zinc-400 phx-no-feedback:focus:ring-zinc-800/5",
|
||||||
|
@class
|
||||||
]}
|
]}
|
||||||
{@rest}
|
{@rest}
|
||||||
><%= @value %></textarea>
|
><%= @value %></textarea>
|
||||||
|
|||||||
Reference in New Issue
Block a user