Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

min-height is unnecessarily set in holder when sticky has dynamic height #73

Open
Hatt0ri opened this issue Nov 19, 2021 · 0 comments
Open

Comments

@Hatt0ri
Copy link

Hatt0ri commented Nov 19, 2021

I have dynamically changing height in MUI accordion. After collapsing it, holder keeps min-height and thus height can't update properly before scrolling.
I changed the code in a way that holderStyles is not getting styles when isFixed false. In my opinion min-height is not needed there when not fixed. My solution below works for me. What do you think?

changed lines
file render-props-version

 holderStyles: isFixed ? {
          minHeight: minHeight + "px"
        } : {}

and

file render-props-version

 var newState = {
        isFixed: isFixed,
        height: wrapperRect.height,
        holderStyles: isFixed ? {
          minHeight: minHeight + "px"
        } : {},
        wrapperStyles: isFixed ? _extends({}, iosRenderingFixStyles, buildStickyStyle(mode, _this.props, {
          boundaryTop: mode === 'bottom' ? boundaryRect.top : 0,
          boundaryBottom: mode === 'top' ? boundaryRect.bottom : 0,
          top: mode === 'top' ? scrollRect.top - (offsets ? offsets.top : 0) : 0,
          bottom: mode === 'bottom' ? scrollRect.bottom - (offsets ? offsets.bottom : 0) : 0,
          width: holderRect.width,
          height: wrapperRect.height
        })) : iosRenderingFixStyles
      };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant