Skip to content

Commit

Permalink
fix: fix fillParent behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed Apr 10, 2024
1 parent 7f5d199 commit 6630b4f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,25 +320,21 @@ export default class ViewSlider extends React.Component<Props, State> {
transitionTimingFunction,
overflow: 'hidden',
height: animateHeight && height != null ? height : undefined,
...(fillParent ? fillStyle : {}),
...style,
}

const finalViewportStyle = {
position: 'relative',
left: `${activeView * spacing * (rtl ? 100 : -100)}%`,
whiteSpace: 'nowrap',
minHeight: '100%',
direction: rtl ? 'rtl' : 'ltr',
transition: transitioning
? `left ${transitionTimingFunction} ${transitionDuration}ms`
: undefined,
...(fillParent ? { height: '100%' } : { minHeight: '100%' }),
...viewportStyle,
}
if (fillParent) {
Object.assign(finalOuterStyle, fillStyle)
Object.assign(finalViewportStyle, fillStyle)
}

// when not transitioning, render empty placeholder divs before the active view to push it into the right
// horizontal position
const views = []
Expand Down

0 comments on commit 6630b4f

Please sign in to comment.