Skip to content

Commit

Permalink
fix(addon-mobile): add smooth opacity change for MobileCalendar to …
Browse files Browse the repository at this point in the history
…hide blinking initial view (#6459)

Co-authored-by: taiga-family-bot <[email protected]>
  • Loading branch information
nsbarsukov and taiga-family-bot authored Jan 16, 2024
1 parent 4b0fd0c commit 4bea934
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import {
styleUrls: ['./mobile-calendar.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
providers: TUI_MOBILE_CALENDAR_PROVIDERS,
host: {'[class._ios]': 'isIOS'},
host: {'[class._ios]': 'isIOS', '[class._initialized]': 'initialized'},
})
export class TuiMobileCalendarComponent implements AfterViewInit {
@ViewChild('yearsScrollRef')
Expand Down Expand Up @@ -118,6 +118,8 @@ export class TuiMobileCalendarComponent implements AfterViewInit {
),
);

initialized = false;

constructor(
@Inject(TUI_IS_IOS) readonly isIOS: boolean,
@Inject(TUI_IS_E2E) readonly isE2E: boolean,
Expand Down Expand Up @@ -304,6 +306,7 @@ export class TuiMobileCalendarComponent implements AfterViewInit {
takeUntil(this.destroy$),
)
.subscribe(() => {
this.initialized = true;
this.updateViewportDimension();
this.initYearScroll();
this.initMonthScroll();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,14 @@
font-size: 1.0625rem;
}
}

.t-week,
.t-years,
.t-months {
.transition(opacity);
opacity: 0;

:host(._initialized) & {
opacity: 1;
}
}
2 changes: 1 addition & 1 deletion projects/cdk/constants/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const TUI_VERSION = `3.62.0`;
export const TUI_VERSION = '3.62.0';

0 comments on commit 4bea934

Please sign in to comment.