Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

[list] Automatic generated id #2265

@AndreKoepke

Description

@AndreKoepke

Describe the bug
The mdc-list and the underlaying mdc-list-items getting automatic a id. Even when the id is manually provided.
The id is in this schema <componet-name>-<n> - so if we have a two lists like this ...

list1 (#mdc-list-1)
 |--> item1 (#mdc-list-item-1)
 |--> item2 (#mdc-list-item-2)
list2 (#mdc-list-2)
 |--> item1 (#mdc-list-item-3)
 |--> item2  (#mdc-list-item-4)

Then the id's a automatic set somewhere. It doesn't matter if we set a id manually (with one variant of <mdc-list-item id="test" [id]="'test'" [attr.id]="'test'" ...), there is always the generated id.

To Reproduce
Steps to reproduce the behavior:

  1. Setup a list and inspect the id's.

Expected behavior
If a id was set manually, then it never gets overwritten.
Otherwise it is really hard to write test-cases for e2e in a big project, when the id`s "randomly" changed.

Screenshots
It seems, that the behaviour is also on the examples.
image

What Angular MDC version are you using? 5.1.1

What OS are you using?: Linux and Windows

What browser(s) is this bug affecting?: Chrome and Firefox

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