File tree Expand file tree Collapse file tree 2 files changed +3
-38
lines changed Expand file tree Collapse file tree 2 files changed +3
-38
lines changed Original file line number Diff line number Diff line change @@ -62,10 +62,6 @@ type AlertOptions = {
62
62
// If -1, the alert will not automatically disappear.
63
63
// If undefined, the default value will be used.
64
64
duration? : number ;
65
-
66
- // Whether or not to animate the alert in, using a hello-goodbye transition.
67
- // Defaults to true.
68
- animate? : boolean ;
69
65
};
70
66
71
67
// The `key` and `duration` options can also be specified as [data-*] attributes
@@ -90,23 +86,6 @@ ui-alerts {
90
86
flex-direction : column-reverse ;
91
87
align-items : flex-end ;
92
88
}
93
-
94
- /* Transitions can be applied to alerts using hello-goodbye */
95
- @media (prefers-reduced-motion: no-preference) {
96
- ui-alerts > .enter-active ,
97
- ui-alerts > .leave-active ,
98
- ui-alerts > .move {
99
- transition : all 0.5s ;
100
- }
101
-
102
- ui-alerts > .enter-from {
103
- transform : translateY (-100% );
104
- }
105
-
106
- ui-alerts > .leave-to {
107
- opacity : 0 ;
108
- }
109
- }
110
89
```
111
90
112
91
## Further Reading
Original file line number Diff line number Diff line change 1
- import { hello , goodbye , move } from 'hello-goodbye' ;
2
-
3
1
export type AlertOptions = {
4
2
key ?: string ;
5
3
duration ?: number ;
6
- animate ?: boolean ;
7
4
} ;
8
5
9
6
export default class AlertsElement extends HTMLElement {
@@ -42,7 +39,7 @@ export default class AlertsElement extends HTMLElement {
42
39
}
43
40
44
41
for ( const child of this . children ) {
45
- this . show ( child as HTMLElement , { animate : false } ) ;
42
+ this . show ( child as HTMLElement ) ;
46
43
}
47
44
}
48
45
@@ -54,16 +51,7 @@ export default class AlertsElement extends HTMLElement {
54
51
el . dataset . key = key ;
55
52
56
53
if ( ! this . contains ( el ) ) {
57
- if ( options . animate === false ) {
58
- this . append ( el ) ;
59
- } else {
60
- move ( this . children , ( ) => {
61
- this . append ( el ) ;
62
- hello ( el ) ;
63
- } ) ;
64
- }
65
- } else {
66
- hello ( el ) ;
54
+ this . append ( el ) ;
67
55
}
68
56
69
57
this . added . add ( el ) ;
@@ -105,9 +93,7 @@ export default class AlertsElement extends HTMLElement {
105
93
106
94
this . added . delete ( elOrKey ) ;
107
95
108
- move ( this . children , ( ) =>
109
- goodbye ( elOrKey ) . then ( ( ) => elOrKey . remove ( ) )
110
- ) ;
96
+ elOrKey . remove ( ) ;
111
97
112
98
this . clearTimeout ( elOrKey ) ;
113
99
}
You can’t perform that action at this time.
0 commit comments