Open dmpour23 opened 6 years ago
Hi, I am trying to focus a CalendarComponent on a page. Initially its hidden and when the user clicks a button is shown however I get an error
Cannot read property 'scrollIntoView' of undefined
console.log(this.myCalendar); CalendarComponent {calSvc: CalendarService, _view: "days", _calendarMonthValue: Array(2), _showToggleButtons: true, _showMonthPicker: true…}
I am using @ViewChild("calendar") myCalendar:ElementRef;
@ViewChild("calendar") myCalendar:ElementRef;
<ion-calendar #calendar ....> this.renderer.invokeElementMethod(this.myCalendar.nativeElement,'focus');
<ion-calendar #calendar ....>
this.renderer.invokeElementMethod(this.myCalendar.nativeElement,'focus');
Why not use *ngIf
*ngIf
I have used *ngIf / [hidden] the problem is I need it to scroll/focus at the center of the calendar. But can seem to do so any suggestions?
Hi, I am trying to focus a CalendarComponent on a page. Initially its hidden and when the user clicks a button is shown however I get an error
I am using
@ViewChild("calendar") myCalendar:ElementRef;
<ion-calendar #calendar ....>
this.renderer.invokeElementMethod(this.myCalendar.nativeElement,'focus');