Make checkboxes focusable with keyboard

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

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}