Skip to content

Commit

Permalink
restore scroll position properly! #160
Browse files Browse the repository at this point in the history
if we set the scrollposition after zooming a theme image then it will always be 0, so we save it before zooming the image to get the exact scroll position!!
  • Loading branch information
siduck committed Jun 23, 2023
1 parent bb46c62 commit 9fa8ef3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/routes/(index)/themes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ function Gallery() {
width={2560}
height={1440}
onclick={() => {
setScrollPosition(window.scrollY);
setZoomedImgPath(key);
setGalleryStatus(!galleryShown());
setScrollPosition(window.scrollY);
}}
/>

Expand Down

2 comments on commit 9fa8ef3

@CheadleCheadle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry about that silly mistake😂

@siduck
Copy link
Member Author

@siduck siduck commented on 9fa8ef3 Jun 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry about that silly mistakejoy

no worries! I was surprised that you knew about solid js xD

Please sign in to comment.