Skip to content

Commit 7b7a2b0

Browse files
committed
Fix Edge glitch when render starts by always applying container position, display and overflow styles.
1 parent 9ce33e9 commit 7b7a2b0

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/ReactCSSTransitionReplace.jsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default class ReactCSSTransitionReplace extends React.Component {
5353
transitionLeave: true,
5454
overflowHidden: true,
5555
notifyLeaving: false,
56-
component: 'span',
56+
component: 'div',
5757
childComponent: 'span',
5858
}
5959

@@ -254,17 +254,15 @@ export default class ReactCSSTransitionReplace extends React.Component {
254254
...containerProps
255255
} = this.props
256256

257+
// In edge there is a glitch as the container switches from not positioned
258+
// to a positioned element at the start of a transition which is solved
259+
// by applying the position and overflow style rules at all times.
257260
containerProps.style = {
258261
...containerProps.style,
262+
position: 'relative',
259263
}
260-
261-
if (Object.keys(this.transitioningKeys).length) {
262-
containerProps.style.position = 'relative'
263-
containerProps.style.display = 'block'
264-
265-
if (overflowHidden) {
266-
containerProps.style.overflow = 'hidden'
267-
}
264+
if (overflowHidden) {
265+
containerProps.style.overflow = 'hidden'
268266
}
269267

270268
if (height !== null) {

0 commit comments

Comments
 (0)