Blank space plus trimSnaps not scrolling #417
-
Hi! I'm building this mobile-first view with react and CSS Grid but trying to use this awesome library to do so isn't working. I have the following JSX: <div className="main" ref={emblaRef}>
<div className="embla__container">
<div className="embla__slide">SLIDE 1</div>
<div className="embla__slide">SLIDE 2</div>
<div className="embla__slide">SLIDE 3</div>
</div>
</div> And this is my current CSS: .main{
background-color: var(--secondary);
display: grid;
place-items: center;
overflow: hidden;
}
.embla__container {
display: grid;
grid-auto-flow: column;
grid-auto-columns: 100vw;
height: 100%;
align-items: center;
}
.embla__slide{
display: grid;
grid-template-rows: 10% auto 20% fit-content(20%) 12%;
background-color: var(--primary);
width: 75%;
height: 90%;
padding: 10px 20px;
margin: 0 20px;
border-radius: 10px;
font-size: 16px;
} The problem is that I get a blank space at the beginning the size of one of the columns and the last column is never able to be scrolled to. Am I missing something? Does anyone have any suggestions? I'd really appreciate any help :) Here's some short videos showing more of each case: without.trimsnaps.mp4with.trimsnaps.mp4 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
Hi @brunoggdev, Please create a CodeSandbox with your setup that demonstrates the problem. Your initial description isn’t clear to me, I don’t have anything but a little JSX snippet to debug so it could be literally anything causing the problems. Best, |
Beta Was this translation helpful? Give feedback.
Hi @brunoggdev,
Please create a CodeSandbox with your setup that demonstrates the problem. Your initial description isn’t clear to me, I don’t have anything but a little JSX snippet to debug so it could be literally anything causing the problems.
Best,
David