tegel
tegel copied to clipboard
[Bug report]: Angular FormControl with tds-dropdown triggers valueChanges on filter input
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
- Add component tds-dropdown
- Add attribute formControlName tied to an Angular FormControl
- Add attribute [filter]=true
- In typescript add a subscription to formControl.valueChanges
- 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