mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-06 19:46:00 +08:00
Make sure output inputs have unique ids
This commit is contained in:
parent
e892d9dea0
commit
c67095bbe1
1 changed files with 5 additions and 0 deletions
|
@ -154,6 +154,7 @@ defmodule LivebookWeb.Output.InputComponent do
|
|||
~H"""
|
||||
<div class="w-60">
|
||||
<.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}
|
||||
|
|
Loading…
Add table
Reference in a new issue