Skip to content

different attribute handling in div/span etc. and svg #240

@rozek

Description

@rozek

I am using "htm" with "preact" binding

When I'm using code like the following

render(html`
  <div  id=${false && 'id-1'} />
  <span id=${false && 'id-2'} />
  <svg  id=${false && 'id-3'}></svg>
  <svg  id=${true  && 'id-4'}></svg>
`, document.body)

"htm" handles the ids differently:

  • <div/> and <span/> get an id with the value "false" while
  • <svg/> elements behave as expected (the first one gets no id, the second one an id with the value id-4)

Is that the expected behaviour? I've also tested other attributes, always with the same result...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions