Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmarcon committed Jan 26, 2024
1 parent c75c13c commit 6578f57
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 26 deletions.
2 changes: 1 addition & 1 deletion lib/live_select/component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule LiveSelect.Component do

use Phoenix.LiveComponent

import Phoenix.HTML.Form,
import PhoenixHTMLHelpers.Form,
only: [text_input: 3, hidden_input: 3]

import LiveSelect.ClassUtil
Expand Down
10 changes: 6 additions & 4 deletions lib/support/live_select_web/live/live_component_form.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule LiveSelectWeb.LiveComponentForm do
alias LiveSelect.CityFinder

import LiveSelect
import Phoenix.HTML.Form
use PhoenixHTMLHelpers

@impl true
def mount(socket) do
Expand All @@ -18,7 +18,7 @@ defmodule LiveSelectWeb.LiveComponentForm do
def render(assigns) do
~H"""
<div id="form_component" phx-hook="Foo" phx-target={@myself}>
<.form for={@form} phx-submit="submit" phx-target={@myself}>
<.form for={@form} phx-submit="submit" phx-change="change" phx-target={@myself}>
<.live_select field={@form[:city_search]} mode={:tags} phx-target={@myself}>
<:option :let={option}>
with custom slot: <%= option.label %>
Expand All @@ -43,12 +43,14 @@ defmodule LiveSelectWeb.LiveComponentForm do
end

@impl true
def handle_event("submit", %{"my_form_old_style" => %{"city_search" => _live_select}}, socket) do
def handle_event("submit", %{"my_form_new_style" => %{"city_search" => live_select}}, socket) do
IO.inspect(live_select, label: "submit")

Check warning on line 47 in lib/support/live_select_web/live/live_component_form.ex

View workflow job for this annotation

GitHub Actions / Build and test with elixir 1.14.0 otp 25.0

There should be no calls to IO.inspect/1.

Check warning on line 47 in lib/support/live_select_web/live/live_component_form.ex

View workflow job for this annotation

GitHub Actions / Build and test with elixir 1.15.0 otp 26.0

There should be no calls to IO.inspect/1.
{:noreply, socket}
end

@impl true
def handle_event("submit", %{"my_form_new_style" => %{"city_search" => _live_select}}, socket) do
def handle_event("change", %{"my_form_new_style" => %{"city_search" => live_select}}, socket) do
IO.inspect(live_select, label: "change")

Check warning on line 53 in lib/support/live_select_web/live/live_component_form.ex

View workflow job for this annotation

GitHub Actions / Build and test with elixir 1.14.0 otp 25.0

There should be no calls to IO.inspect/1.

Check warning on line 53 in lib/support/live_select_web/live/live_component_form.ex

View workflow job for this annotation

GitHub Actions / Build and test with elixir 1.15.0 otp 26.0

There should be no calls to IO.inspect/1.
{:noreply, socket}
end
end
2 changes: 2 additions & 0 deletions lib/support/live_select_web/live/showcase_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ defmodule LiveSelectWeb.ShowcaseLive do
import LiveSelect
alias LiveSelect.Component

use PhoenixHTMLHelpers

defmodule Settings do
use Ecto.Schema

Expand Down
3 changes: 2 additions & 1 deletion lib/support/live_select_web/views/error_helpers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ defmodule LiveSelectWeb.ErrorHelpers do
Conveniences for translating and building error messages.
"""

use Phoenix.HTML
import Phoenix.HTML.Form
use PhoenixHTMLHelpers

@doc """
Generates tag for inlined form input errors.
Expand Down
3 changes: 2 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ defmodule LiveSelect.MixProject do
defp deps do
[
{:phoenix_live_view, "~> 0.19"},
{:phoenix_html, "~> 3.3"},
{:phoenix_html, "~> 4.0"},
{:phoenix_html_helpers, "~> 1.0"},
{:jason, "~> 1.0"},
{:phoenix, ">= 1.6.0", optional: true},
{:phoenix_live_reload, "~> 1.2", only: :dev},
Expand Down
Loading

0 comments on commit 6578f57

Please sign in to comment.