components icon indicating copy to clipboard operation
components copied to clipboard

mat-checkbox does not respect component instance boundaries

Open saimonsez opened this issue 8 years ago • 2 comments

Bug, feature request, or proposal:

Bug

What is the expected behavior?

<mat-checkbox id="x"/> should not interfer with <mat-checkbox id="x"/> if the surrounding component is instantiated twice

What is the current behavior?

checking the checkbox on the second instance triggers a check on the first instance.

What are the steps to reproduce?

create a component containing a checkbox with an id: <mat-checkbox id="x"/> use that component twice from another component: <my-component id="a"/> <my-component id="b"/>

Click the second checkbox. The first checkbox is checked instead of the second one.

What is the use-case or motivation for changing an existing behavior?

mat-slide-toggle seems not to be affected, so I think this is a bug with mat-checkbox.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

angular 6.0.3 material 6.2.1

Is there anything else we should know?

saimonsez avatar Oct 04 '18 11:10 saimonsez

Having two elements with the same ID is invalid HTML, so this isn't something we would address.

jelbourn avatar Oct 04 '18 19:10 jelbourn

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.