tegel icon indicating copy to clipboard operation
tegel copied to clipboard

[Bug report]: Angular FormControl with tds-dropdown triggers valueChanges on filter input

Open scania-mharlin opened this issue 7 months ago • 0 comments

Requirements before reporting

  • [X] No duplicated issue reported.
  • [X] I have checked the latest version if the bug exist there. See all available packages at npmJS.com
  • [X] I have followed the installation guide.

Package versions

@scania/tegel-angular: 1.11.0

Browser

Chrome

Framework

Angular

Version

Angular 17

Reproduction steps

  1. Add component tds-dropdown
  2. Add attribute formControlName tied to an Angular FormControl
  3. Add attribute [filter]=true
  4. In typescript add a subscription to formControl.valueChanges
  5. Use the filter in the dropdown and observe that the valueChange subscription triggers on every character input in the Filter input.

Code example

HTML

<tds-dropdown [filter]="true" formControlName="controlName">
  <tds-dropdown-option></tds-dropdown-option>
</tds-dropdown>

Typescript

this.controlName = new FormControl<string>("");

this.controlName.valueChanges.subscribe(value => {
   console.log("change value: ", value);
 });

Screenshots

Add/Copy screenshot here

Expected behaviour

The valueChanges should not be triggered when using the filter input in Dropdown

Console errors

Contact information

[email protected]

scania-mharlin avatar Jul 11 '24 13:07 scania-mharlin