Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

itemView with nowrap=true doesn't work when template produces TR #873

@npoppeli

Description

@npoppeli

When you have an itemView with option nowrap=true and a template that produces a single TR element (with lots of things inside the TR), Chaplin raises an error in line 432 of view.coffee. Try this for demonstration:

$ ->
  html = """<tr><td>text1</td><td>text2</td>
            <td><button id='id1'><span class='fa fa-pencil'></span></button></td>
            <td><button id='id2'><span class='fa fa-pencil'></span></button></td>
          </tr>"""
  el = document.createElement 'div'
  el.innerHTML = html
  for child, l in el.children
    console.log "child #{l}: #{child.tagName} id=#{child.id}"

There are two elements in el.children, namely the two buttons. Appararently the innerHTML() method discards the TR and TD nodes (tested on Chromium 48.0 and Firefox 44.0). I don't know if this should be fixed in the code, or clarified in the documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions