File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 1
1
### v3.0.1 (2 October 2017)
2
2
3
3
* [ BUGFIX] Prevent animating child selection with CSS rather than clearing with JS so form inputs don't lose focus on each update. (#50 )
4
+ * [ BUGFIX] Switch the container to relative positioning on the render before the transitions start to avoid the glitch
5
+ in Edge without using permanent relative positioning which is not an option. (#52 )
4
6
5
7
### v3.0.0 (27 August 2017)
6
8
Original file line number Diff line number Diff line change @@ -251,15 +251,17 @@ export default class ReactCSSTransitionReplace extends React.Component {
251
251
...containerProps
252
252
} = this . props
253
253
254
- // In edge there is a glitch as the container switches from not positioned
255
- // to a positioned element at the start of a transition which is solved
256
- // by applying the position and overflow style rules at all times.
254
+ const transitioning = this . shouldEnterCurrent || this . keysToLeave . length || Object . keys ( this . transitioningKeys ) . length
255
+
257
256
containerProps . style = {
258
257
...containerProps . style ,
259
- position : 'relative' ,
260
258
}
261
- if ( overflowHidden ) {
262
- containerProps . style . overflow = 'hidden'
259
+
260
+ if ( transitioning ) {
261
+ containerProps . style . position = 'relative'
262
+ if ( overflowHidden ) {
263
+ containerProps . style . overflow = 'hidden'
264
+ }
263
265
}
264
266
265
267
if ( height !== null ) {
@@ -306,9 +308,11 @@ export default class ReactCSSTransitionReplace extends React.Component {
306
308
React . createElement ( childComponent ,
307
309
{
308
310
key : currentKey ,
309
- // Positioning must always be specified to keep the
310
- // current child on top of the leaving children
311
- style : this . transitioningKeys [ currentKey ] ? positionAbsolute : { position : 'relative' } ,
311
+ // While there are leaving children positioning must always be specified to keep the current
312
+ // child on top; the current child can switch to relative positioning after entering though.
313
+ style : this . transitioningKeys [ currentKey ]
314
+ ? positionAbsolute
315
+ : ( transitioning ? { position : 'relative' } : null ) ,
312
316
} ,
313
317
this . wrapChild (
314
318
currentChild ,
You can’t perform that action at this time.
0 commit comments