trimox / angular-mdc-web

Angular wrapper for Material Design (Web) Components
https://trimox.github.io/angular-mdc-web
MIT License
519 stars 87 forks source link

[list] Automatic generated id #2265

Open AndreKoepke opened 4 years ago

AndreKoepke commented 4 years ago

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