Skip to content

False positive "duplicated id" combined with if.bind #188

@RomkeVdMeulen

Description

@RomkeVdMeulen

I have this construction in my template:

<input type="text" list="my-options">
<datalist if.bind="type === 'server' id="my-options">
  <option repeat.for="server of servers" value="${server.name}">
</datalist>
<datalist if.bind="type === 'domain' id="my-options">
  <option repeat.for="domain of domains" value="${domain.name}">
</datalist>

Only one datalist will ever be rendered, so there should not be a problem with multiple elements having the id "my-options". However, the template linter gives this warning:

WARNING: duplicated id: my-options Ln 5 Col 4 mytemplate.html

The linter should not give a duplicate id warning if all the elements with the same id all have an if.bind.

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