Skip to content

Commit

Permalink
feat: improved text input
Browse files Browse the repository at this point in the history
  • Loading branch information
theycallmehero committed Nov 9, 2021
1 parent d2d7868 commit 4ab45b6
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 287 deletions.
3 changes: 0 additions & 3 deletions lib/moon/components/select.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ defmodule Moon.Components.Select do
options={options_with_selected}
opts={[prompt: @prompt]}
/>
<Surface.Components.Context get={Surface.Components.Form, form: form}>
<ErrorTag field={@field} :if={form} />
</Surface.Components.Context>
"""

~F"""
Expand Down
4 changes: 1 addition & 3 deletions lib/moon/components/text_input.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ defmodule Moon.Components.TextInput do

use Moon.StatelessComponent
alias Moon.Components.Label
alias Moon.Components.ErrorTag

prop field, :atom
prop label, :string
Expand Down Expand Up @@ -73,14 +72,13 @@ defmodule Moon.Components.TextInput do
opts={
placeholder: @placeholder,
disabled: @disabled,
required: @required,
required: @required && !@disabled,
type: @type
}
value={@value}
focus={@focus}
blur={@blur}
/>
<ErrorTag field={@field} />
</div>
"""

Expand Down
2 changes: 1 addition & 1 deletion lib/moon_web/components/example_and_code.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ defmodule MoonWeb.Components.ExampleAndCode do

def render(assigns) do
~F"""
<div class={"rounded-lg p-0 mb-8 #{@class}"}>
<div class={"rounded p-0 mb-8", @class}>
<PreviewCodeButton
class="justify-end"
title={@title}
Expand Down
Loading

0 comments on commit 4ab45b6

Please sign in to comment.