-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Unable to change month and first click isn't registered when directive uses formControlName for Angular 15 #618
Comments
I was checking this issue and i found something strange When we first declare the value and return it from the same getter, it works https://stackblitz.com/edit/angular-ivy-cbn2yw?file=src/app/hello.component.ts Although i could not able to debug the reason behind this |
I hope to have a look into it this weekend |
When we return it from a function (It doesn't work as expected)@Component({
selector: 'hello',
template: `
<form [formGroup]="form">
<input
formControlName="datetime"
[dpDayPicker]="config()"
mode="daytime"
theme="dp-material dp-main" />
</form>`,
styles: [`h1 { font-family: Lato; }`],
})
export class HelloComponent implements OnInit {
form!: FormGroup;
config(): IDatePickerDirectiveConfig {
return {
minutesInterval: 5,
firstDayOfWeek: 'mo',
format: 'DD-MM-YYYY H:mm',
};;
}
ngOnInit(): void {
this.form = new FormGroup({
datetime: new FormControl(null),
});
}
} When we have an object created already, and we just have to return (it works) private _config: IDatePickerDirectiveConfig = {
minutesInterval: 5,
firstDayOfWeek: 'mo',
format: 'DD-MM-YYYY H:mm',
};
config(): IDatePickerDirectiveConfig {
return this._config;
} |
I assume there is some kind of horse condition here [creating object ref and then return vs just returning the ref for already created object] |
I'm using Angular 15, and I have a control that looks like this:
There are two symptoms (seems to be across all browsers):
https://stackblitz.com/edit/angular-ivy-fayr91?file=src/app/hello.component.ts
The text was updated successfully, but these errors were encountered: