From c67095bbe12bcfd8fbc40d88875b343350e2d24f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Mon, 25 Mar 2024 20:07:16 +0700 Subject: [PATCH] Make sure output inputs have unique ids --- lib/livebook_web/live/output/input_component.ex | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/livebook_web/live/output/input_component.ex b/lib/livebook_web/live/output/input_component.ex index 89fd2cac9..24de315e1 100644 --- a/lib/livebook_web/live/output/input_component.ex +++ b/lib/livebook_web/live/output/input_component.ex @@ -154,6 +154,7 @@ defmodule LivebookWeb.Output.InputComponent do ~H"""
<.select_field + id={@id} name="html_value" value={Enum.find_index(@attrs.options, fn {key, _label} -> key == @value end)} options={Enum.with_index(@attrs.options, fn {_key, label}, idx -> {label, idx} end)} @@ -179,6 +180,7 @@ defmodule LivebookWeb.Output.InputComponent do type="range" data-el-input class="range-input" + id={@id} name="html_value" value={@value} phx-debounce={@attrs.debounce} @@ -234,6 +236,7 @@ defmodule LivebookWeb.Output.InputComponent do <.text_field type="date" data-el-input + id={@id} name="html_value" value={@value} phx-debounce="blur" @@ -253,6 +256,7 @@ defmodule LivebookWeb.Output.InputComponent do type="color" class="h-12" data-el-input + id={@id} name="html_value" value={to_string(@value)} phx-debounce={@attrs.debounce} @@ -271,6 +275,7 @@ defmodule LivebookWeb.Output.InputComponent do <.text_field type={html_input_type(@attrs.type)} data-el-input + id={@id} name="html_value" value={to_string(@value)} phx-debounce={@attrs.debounce}