Skip to content

Commit 6630b4f

Browse files
committed
fix: fix fillParent behavior
1 parent 7f5d199 commit 6630b4f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/index.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -320,25 +320,21 @@ export default class ViewSlider extends React.Component<Props, State> {
320320
transitionTimingFunction,
321321
overflow: 'hidden',
322322
height: animateHeight && height != null ? height : undefined,
323+
...(fillParent ? fillStyle : {}),
323324
...style,
324325
}
325326

326327
const finalViewportStyle = {
327328
position: 'relative',
328329
left: `${activeView * spacing * (rtl ? 100 : -100)}%`,
329330
whiteSpace: 'nowrap',
330-
minHeight: '100%',
331331
direction: rtl ? 'rtl' : 'ltr',
332332
transition: transitioning
333333
? `left ${transitionTimingFunction} ${transitionDuration}ms`
334334
: undefined,
335+
...(fillParent ? { height: '100%' } : { minHeight: '100%' }),
335336
...viewportStyle,
336337
}
337-
if (fillParent) {
338-
Object.assign(finalOuterStyle, fillStyle)
339-
Object.assign(finalViewportStyle, fillStyle)
340-
}
341-
342338
// when not transitioning, render empty placeholder divs before the active view to push it into the right
343339
// horizontal position
344340
const views = []

0 commit comments

Comments
 (0)