Make checkboxes focusable with keyboard

This commit is contained in:
Jonatan Kłosko 2024-08-07 17:57:30 +09:00
parent edefa6649a
commit 1a3c5b75c5

View file

@ -295,11 +295,11 @@ defmodule LivebookWeb.FormComponents do
~H"""
<div>
<label class="flex items-center gap-2 cursor-pointer">
<label class="flex items-center gap-2 cursor-pointer relative">
<input :if={@unchecked_value} type="hidden" value={@unchecked_value} name={@name} />
<input
type="checkbox"
class="peer hidden"
class="peer opacity-0 absolute top-0 left-0"
value={@checked_value}
name={@name}
id={@id || @name}