Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

<Label> has no way of providing the input value

Đang mở
#568 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
elixir
Lĩnh vực
frontend

Hướng nghiên cứu

Start at the Label component and trace its use of input_id/2 versus input_id/3, using the reproduction markup with a nested RadioButton as the behavioral check. The work is done when the label correctly selects a nested radio button or supports an explicit input value for cases where wrapping is not feasible.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Describe the bug

The Label component internally uses input_id/2, never input_id/3. The generated for attribute is never correct for a radio button or checkbox.

As a workaround, I am currently doing

<Label opts={for: nil}>
  <RadioButton value="value" />
  label text
</Label>

How to reproduce it

Clicking on the label text with this markup

<Label>
  <RadioButton value="value" />
  label text
</Label>

There are probably also legitimate use cases where wrapping the around the input is not feasible, so it would be good to allow <Label value={...}>text</Label> or similar.

does not select the nested radio button.

Your Environment

Surface: v0.7.0
LiveView: v0.17.6
Elixir: v1.13.0 (compiled with Erlang/OTP 24)

Ngôn ngữ chính
Elixir
Star
2.1k
Fork
146
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của surface-ui/surface

Tất cả issue của surface-ui/surface

Issue tương tự

Thêm issue về Elixir

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.