Currently encountering some unusual behavior with my photo gallery. Whenever I click on a thumbnail to view an image, not only does the image display but it also causes the page to scroll up. If the gallery is positioned slightly below the top of the screen, it scrolls upwards. Conversely, if it extends beyond the top of the screen, it scrolls downwards until the top of the Gallery section aligns with the screen's top.
I attempted to recreate this issue on codepen: https://codepen.io/dmontesi/pen/VJZeVq. My code consists of SCSS and HTML only.
<!-- Gallery -->
<section class="wrapper">
<div class="wrapper__gall">
<ul class="slides">
<li id="slide1"><img src="https://cdn.pixabay.com/photo/2016/06/24/11/49/architecture-1477103_960_720.jpg" alt="" /></li>
<li id="slide2"><img src="https://cdn.pixabay.com/photo/2016/06/24/11/48/architecture-1477101_960_720.jpg" alt="" /></li>
<li id="slide3"><img src="https://cdn.pixabay.com/photo/2016/06/24/11/46/architecture-1477099_960_720.jpg" alt="" /></li>
</ul>
<ul class="thumbnails">
<li>
<a href="#slide1"><img src="https://cdn.pixabay.com/photo/2016/06/24/11/49/architecture-1477103_960_720.jpg" /></a>
</li>
<li>
<a href="#slide2"><img src="https://cdn.pixabay.com/photo/2016/06/24/11/48/architecture-1477101_960_720.jpg" /></a>
</li>
<li>
<a href="#slide3"><img src="https://cdn.pixabay.com/photo/2016/06/24/11/46/architecture-1477099_960_720.jpg" /></a>
</li>
</ul>
</div>
</section>
The goal is for the gallery to display the next slide without altering the user's position on the screen.