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

Non-closing tags with directive fail. #18

Closed
saverio-kantox opened this issue Jan 15, 2020 · 2 comments
Closed

Non-closing tags with directive fail. #18

saverio-kantox opened this issue Jan 15, 2020 · 2 comments

Comments

@saverio-kantox
Copy link

saverio-kantox commented Jan 15, 2020

A tag like the following (which I wanted to use as first information in a table where the first visible header row does not have all the columns)

<col :for={{ c <- @cols }}>

fails to be parsed.

Full context:

<table>
  <col :for={{ _ <- @cols }}>
  <thead>
    <tr><th colspan="99">This row only has one cell, so table layout would fail without the COL tags.</th></tr>
    <tr><th :for={{ c <- @cols }}>{{ c.title }}</th></tr>
  </thead>
  ....
</table>
@saverio-kantox
Copy link
Author

The only solution I have found is to define a very simple component

defmodule Col do
  def render(assigns) do
    ~H"""
    <col>
    """
  end
end

and then use it as a self-closing component:

<table>
  <Col :for={{ _ <- @cols }} />
  <thead>...

@msaraiva
Copy link
Member

Fixed in 4e51378

@saverio-kantox thanks for reporting this issue!

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

No branches or pull requests

2 participants