Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omit meaningless markup from hidden input in core components #5700

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions installer/templates/phx_web/components/core_components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,12 @@ defmodule <%= @web_namespace %>.CoreComponents do
"""
end

def input(%{type: "hidden"} = assigns) do
~H"""
<input type="hidden" name={@name} id={@id} value={@value} {@rest} />
"""
end

# All other inputs text, datetime-local, url, password, etc. are handled here...
def input(assigns) do
~H"""
Expand Down
6 changes: 6 additions & 0 deletions priv/templates/phx.gen.live/core_components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,12 @@ defmodule <%= @web_namespace %>.CoreComponents do
"""
end

def input(%{type: "hidden"} = assigns) do
~H"""
<input type="hidden" name={@name} id={@id} value={@value} {@rest} />
"""
end

# All other inputs text, datetime-local, url, password, etc. are handled here...
def input(assigns) do
~H"""
Expand Down
Loading