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

When using :on-click={"name", target="#target_id"} I cannot seem to get a sibling to target another sibling node that is rendered in the same parent.

Đang mở
#712 1 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
elixir
Lĩnh vực
frontend

Hướng nghiên cứu

Start by reducing the reported :on-click target behavior to a minimal Surface/LiveView example with sibling components, using the shown tokenslotrail component as the target. Verify whether sibling live components can receive the event and target selector, then compare the result with the documented behavior; done means the limitation or defect is established and the issue has a reproducible case or documentation direction.

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

Mô tả

Describe the bug

I have a liveview with two components that render content into their slots. One is a live component that has a substate managing some ui, the other is simply a component with a button in it that I want to trigger a function in the live component.

The heirarchy is:

When I use the following action.

image

You can clearly see the on click event.

The component is rendered int he parent liveview ->

image

I can target the parent (which is the liveview) fairly easily and that is great, but when I want to talk to a sibling live component, rendered in the same liveview -> as thus:

I get an error in the console:

image

and just for completion here is the call to "tokenslotrail", the component I want to target, which is rendered in the same parent liveview.

image

Is there some limitation I am missing? The documentation is very sparse and I can't understand why I simply cannot target any node I want by id.

Thank you so much for helping

How to reproduce it

  1. ... It should be obvious from above.

The behavior you expected

I expect a onclick target Js push to simply target the node that I want to when I push the event to it and pattern match the handle_event there.

Your Environment

Surface: v0.1.1
LiveView: v0.19
Elixir: v1.14.2

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.