I'm making a website and wanted to use scroll-snap-type. The problem is that it always skips one element on mobile view. That happens only in Chrome, in Firefox it works fine. Any idea how to make it work in Chrome?
body {
margin: 0;
}
.container {
max-height: 100vh;
overflow: scroll;
scroll-snap-type: y mandatory;
}
.item {
height: 100vh;
border-bottom: 5px solid white;
scroll-snap-align: center;
background-color: black;
color: white;
display: flex;
align-items: center;
justify-content: center;
scroll-snap-stop: always;
}
<div class="container">
<div class="item">
A
</div>
<div class="item">
B
</div>
<div class="item">
C
</div>
<div class="item">
D
</div>
</div>