diff --git a/lib/live_debugger_web/components.ex b/lib/live_debugger_web/components.ex index eabf96536..90b1a03cf 100644 --- a/lib/live_debugger_web/components.ex +++ b/lib/live_debugger_web/components.ex @@ -599,6 +599,7 @@ defmodule LiveDebuggerWeb.Components do attr(:checked, :boolean, default: false, doc: "Whether the switch is checked.") attr(:label, :string, default: "", doc: "Label for the switch.") attr(:wrapper_class, :any, default: nil, doc: "Additional classes to add to the switch.") + attr(:id, :string, default: nil, doc: "ID of the switch.") attr(:rest, :global) def toggle_switch(assigns) do @@ -610,7 +611,7 @@ defmodule LiveDebuggerWeb.Components do <%= @label %> - +
diff --git a/lib/live_debugger_web/components/tree.ex b/lib/live_debugger_web/components/tree.ex index 2740baa5e..b2f7ef54b 100644 --- a/lib/live_debugger_web/components/tree.ex +++ b/lib/live_debugger_web/components/tree.ex @@ -36,7 +36,12 @@ defmodule LiveDebuggerWeb.Components.Tree do
<%= @title %>
<%= if LiveDebugger.Feature.enabled?(:highlighting) do %> - <.toggle_switch label="Highlight" checked={@highlight?} phx-click="toggle-highlight" /> + <.toggle_switch + id="highlight-switch" + label="Highlight" + checked={@highlight?} + phx-click="toggle-highlight" + /> <% end %>