Skip to content

Commit 8ef9fe8

Browse files
hqtoan94mattlewis92
authored andcommitted
fix(month-view): make slide animation smoother
Closes #1017
1 parent f7ad18d commit 8ef9fe8

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

projects/angular-calendar/src/modules/month/calendar-open-day-events.component.ts

+21-8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
import {
99
trigger,
1010
style,
11+
state,
1112
transition,
1213
animate,
1314
AnimationTriggerMetadata
@@ -16,14 +17,26 @@ import { CalendarEvent } from 'calendar-utils';
1617
import { trackByEventId } from '../common/util';
1718

1819
export const collapseAnimation: AnimationTriggerMetadata = trigger('collapse', [
19-
transition('void => *', [
20-
style({ height: 0, overflow: 'hidden' }),
21-
animate('150ms', style({ height: '*' }))
22-
]),
23-
transition('* => void', [
24-
style({ height: '*', overflow: 'hidden' }),
25-
animate('150ms', style({ height: 0 }))
26-
])
20+
state(
21+
'void',
22+
style({
23+
height: 0,
24+
overflow: 'hidden',
25+
'padding-top': 0,
26+
'padding-bottom': 0
27+
})
28+
),
29+
state(
30+
'*',
31+
style({
32+
height: '*',
33+
overflow: 'hidden',
34+
'padding-top': '*',
35+
'padding-bottom': '*'
36+
})
37+
),
38+
transition('* => void', animate('150ms ease-out')),
39+
transition('void => *', animate('150ms ease-in'))
2740
]);
2841

2942
@Component({

0 commit comments

Comments
 (0)