Skip to content

Commit

Permalink
Add: Auto-scroll on mobile devices
Browse files Browse the repository at this point in the history
  • Loading branch information
antidoid committed Jan 30, 2024
1 parent 4fcdec9 commit 300adf9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ function App() {

const handleDownloadBtn = async () => {
setIsLoading(true);

// Scroll to bottom of the page on mobile devices
if (window.innerWidth < 640)
window.scrollTo({
top: document.body.scrollHeight,
behavior: "smooth",
});

try {
const res = await fetch(requesturl);
const { qr_code_url: imgLink } = await res.json();
Expand Down

0 comments on commit 300adf9

Please sign in to comment.