Ionic2-Calendar icon indicating copy to clipboard operation
Ionic2-Calendar copied to clipboard

Next Slide Styles Loading Delayed

Open GodsFavoriteDeveloper opened this issue 5 years ago • 3 comments

After adding these custom styles on global.scss they work but when i navigate to the next slide they are delayed. The screen first renders without them, then after a split second they are then applied

.table > tbody > tr > td { padding: 0px !important; border: 1px solid #f4df9c !important; } .table > thead > tr > td { border: 1px solid var(--ion-color-secondary) !important; } .table-bordered > thead > tr > th { border: 1px solid var(--ion-color-secondary) !important; } .monthview-datetable td.monthview-disabled { color: #999999 !important; }

GodsFavoriteDeveloper avatar Feb 13 '20 14:02 GodsFavoriteDeveloper

@GodsFavoriteDeveloper Did you use any custom template in the calendar. From your description, it seems your css styles only applies to the current slide (active slide), it doesn't apply to the next slide(inactive slide). So only when next slide becomes to current slide, some css class is applied and the styles take effect.

twinssbc avatar Feb 14 '20 00:02 twinssbc

Thanks. So how can I fix this? I added my styles to global.css and I'm using a custom template. Below is my custom template

<ng-template #template let-view="view" let-row="row" let-col="col"> <div ngIf="view.dates[row7+col].events == ''">

{{view.dates[row7+col].label}}
<div class="outer-date-box" ngFor="let obj of view.dates[row7+col].events"> <div class="date-box" [ngStyle]="{'background': obj.eventColor } "> {{view.dates[row7+col].label}}

GodsFavoriteDeveloper avatar Mar 09 '20 19:03 GodsFavoriteDeveloper

@GodsFavoriteDeveloper Are you customizing monthviewDisplayEventTemplate? If you also want to add some customization to your inactive months, you could customize on monthviewInactiveDisplayEventTemplate.

twinssbc avatar Mar 22 '20 06:03 twinssbc