question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Auto height issue

See original GitHub issue

Description

How to make the slider responsive with auto height?

I have a dynamic content inside the slider. There might be slides with different height. if the content is very high I don’t see part of the content. My slider is in the Dialog. Code looks like:

const flicking = React.useRef(null);

React.useEffect(() => {
    if (flicking.current) {
      flicking.current.resize();  //Seems it doesn't help also
    }
}, [props.slots]);

return (
  <Flicking
        style={{height: "100%"}} //without that style I don't see content at all
        gap={20}
        bound
        ref={flicking}
        lastIndex={60}
        infinite
        infiniteThreshold={400}
        onNeedPanel={handleNeedPanel}
        resizeOnContentsReady
      >
          {props.slots.map(slot => <div style={{width: 'calc(33% - 13px)'}}>some high content</div>)}
  </Flicking>
)

As you can see on the screenshot, there is not any scrollbar and part of the content is just hidden

27be7da144

is there any ideas how it could be improved?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
WoodNeckcommented, Apr 4, 2021

Looks like it’s a bug of Flicking that occurs when there’re no panels but added after like you’ve said. I’ll fix this after, thanks for reporting!

0reactions
matiosfreecommented, Apr 16, 2021

@WoodNeck Yeah, it works for me now. Awesome work. Thanks 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS height auto is not working in relative DIV - Stack Overflow
In reality when I set height:auto for relative div this div is not showing. If I set any height value ie: height:150px; relative...
Read more >
What's the deal with height: auto? - YouTube
My video on width: auto : https://www.youtube.com/watch?v=-st14lUQD3U&list=PL4-IK0AVhVjP27yZLwW-gkPggRps0CCnP&index=18Write HTML 10x faster ...
Read more >
Why doesnt the CSS height: auto; work! - SitePoint
I think there is a Bug with CSS. That is the height: auto; is not working! To be exact look here: http://www.notefab.com/features.php.
Read more >
Setting Height And Width On Images Is Important Again
Layout shifts happen when height: auto is used in CSS. (Large preview). Wait, what's going on here? We're back to the first problem....
Read more >
Auto Row Height problems with multiple auto-height columns
Starting in v.26.2.0, if there are multiple auto-height columns in a table, the smaller auto-height cells don't fill the entire row.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found