@@ -187,10 +187,23 @@ export default class LeftPanel2 extends React.Component<IProps, IState> {
187
187
if ( header . style . top !== newTop ) {
188
188
header . style . top = newTop ;
189
189
}
190
- } else if ( style . stickyBottom ) {
190
+ } else {
191
+ if ( header . classList . contains ( "mx_RoomSublist2_headerContainer_stickyTop" ) ) {
192
+ header . classList . remove ( "mx_RoomSublist2_headerContainer_stickyTop" ) ;
193
+ }
194
+ if ( header . style . top ) {
195
+ header . style . removeProperty ( 'top' ) ;
196
+ }
197
+ }
198
+
199
+ if ( style . stickyBottom ) {
191
200
if ( ! header . classList . contains ( "mx_RoomSublist2_headerContainer_stickyBottom" ) ) {
192
201
header . classList . add ( "mx_RoomSublist2_headerContainer_stickyBottom" ) ;
193
202
}
203
+ } else {
204
+ if ( header . classList . contains ( "mx_RoomSublist2_headerContainer_stickyBottom" ) ) {
205
+ header . classList . remove ( "mx_RoomSublist2_headerContainer_stickyBottom" ) ;
206
+ }
194
207
}
195
208
196
209
if ( style . stickyTop || style . stickyBottom ) {
@@ -209,21 +222,12 @@ export default class LeftPanel2 extends React.Component<IProps, IState> {
209
222
if ( header . classList . contains ( "mx_RoomSublist2_headerContainer_sticky" ) ) {
210
223
header . classList . remove ( "mx_RoomSublist2_headerContainer_sticky" ) ;
211
224
}
212
- if ( header . classList . contains ( "mx_RoomSublist2_headerContainer_stickyTop" ) ) {
213
- header . classList . remove ( "mx_RoomSublist2_headerContainer_stickyTop" ) ;
214
- }
215
- if ( header . classList . contains ( "mx_RoomSublist2_headerContainer_stickyBottom" ) ) {
216
- header . classList . remove ( "mx_RoomSublist2_headerContainer_stickyBottom" ) ;
217
- }
218
225
if ( headerContainer . classList . contains ( "mx_RoomSublist2_headerContainer_hasSticky" ) ) {
219
226
headerContainer . classList . remove ( "mx_RoomSublist2_headerContainer_hasSticky" ) ;
220
227
}
221
228
if ( header . style . width ) {
222
229
header . style . removeProperty ( 'width' ) ;
223
230
}
224
- if ( header . style . top ) {
225
- header . style . removeProperty ( 'top' ) ;
226
- }
227
231
}
228
232
}
229
233
0 commit comments