Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raise when declaring global attr within a slot #2164

Closed
chrismccord opened this issue Aug 30, 2022 · 1 comment · Fixed by #2294
Closed

raise when declaring global attr within a slot #2164

chrismccord opened this issue Aug 30, 2022 · 1 comment · Fixed by #2294

Comments

@chrismccord
Copy link
Member

No description provided.

@Carl-Foster
Copy link

I just ran into this issue when trying to define a select input with values. Usage was like this:

~H"""
<.input type="select" field={{f, :energy}} label="Energy Level">
      <:option value="" hidden={true}>Select an option</:option>
      <:option :for={value <- Ecto.Enum.values(Canvas, :energy)} value={value}>
        <%= value %>
      </:option>
 </.input>
"""

How could I provide the other attributes of an option without having to define each individually? My current idea is using assigns_to_attributes(opt, [:value]) however then there is the compile time warning of passing in attributes which are unknown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants