sek-consulting / solid-ui

Beautifully designed components. Built with Kobalte & corvu. Styled with Tailwind CSS.
https://www.solid-ui.com
MIT License
834 stars 32 forks source link

Checkbox Label has incorrect "for" value #6

Closed arvalaan closed 1 year ago

arvalaan commented 1 year ago

In the checkbox-demo there's a label with a "for" value that points to terms1, however, Kobalte makes the checkbox input box have an id which is terms1-input. Hence the label is not clickable.

This would fix the example:

import { ComponentExample } from "~/components/component-example"
import { Checkbox } from "~/components/ui/checkbox"

export function CheckboxDemo() {
  return (
    <ComponentExample>
      <div class="items-top flex space-x-2">
        <Checkbox id="terms1" />
        <div class="grid gap-1.5 leading-none">
          <label
            for="terms1-input"
            class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
          >
            Accept terms and conditions
          </label>
          <p class="text-muted-foreground text-sm">
            You agree to our Terms of Service and Privacy Policy.
          </p>
        </div>
      </div>
    </ComponentExample>
  )
}