Please provide the environment you discovered this bug in.
@Component({
selector: 'spartan-select-preview',
standalone: true,
imports: [BrnSelectImports, HlmSelectImports, ReactiveFormsModule],
template: `
<form [formGroup]="form">
<brn-select class="inline-block" formControlName="value" placeholder="Select an option">
<hlm-select-trigger class="w-56">
<hlm-select-value />
</hlm-select-trigger>
<hlm-select-content>
<hlm-option value="Refresh">Refresh</hlm-option>
<hlm-option value="Settings">Settings</hlm-option>
<hlm-option value="Help">Help</hlm-option>
<hlm-option value="Signout">Sign out</hlm-option>
</hlm-select-content>
</brn-select>
</form>
`,
})
export class SelectPreviewComponent {
form = new FormGroup({
value: new FormControl('Help'), // we have an initial value here
});
constructor() {
this.form.valueChanges.subscribe((value) => {
console.log(value); // the value you select will be skipped the first time
});
}
ngOnInit() {
setTimeout(() => {
this.form.patchValue({ value: 'Help' }); // we set the same value again here asynchronously
});
}
}
Which area/package is the issue in?
select
Description
If we update the value asynchronously and set the same value as in the initial form value. The first selection will be skipped.
Please provide the exception or error you saw
No response
Other information
No response
I would be willing to submit a PR to fix this issue
Please provide the environment you discovered this bug in.
Which area/package is the issue in?
select
Description
If we update the value asynchronously and set the same value as in the initial form value. The first selection will be skipped.
Please provide the exception or error you saw
No response
Other information
No response
I would be willing to submit a PR to fix this issue