Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions components/buttons/ScrollButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ function ScrollButton() {

return (
<div className='fixed bottom-14 right-4 z-40 h-16 w-12'>
{backToTopButton && (
<button className='rounded-full bg-white shadow-md ' onClick={scrollUp}>
<img src={scrollImage} alt='scroll to top' />
</button>
)}
<button
className={`rounded-full bg-white shadow-md ${backToTopButton ? 'visible' : 'pointer-events-none invisible'}`}
Copy link
Member

Choose a reason for hiding this comment

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

Kind of confused as how these changes are leading to fix the error in safari?

Copy link
Author

Choose a reason for hiding this comment

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

The issue was due to an empty true condition, which led to unexpected behavior, img copies in DOM, By updating this condition to execute a specific action when true, we effectively resolved the issue as highlighted by codeRabbit. The issue and solution videos illustrate this difference clearly.

Copy link
Author

Choose a reason for hiding this comment

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

onClick={scrollUp}
>
<img src={scrollImage} alt='scroll to top' />
</button>
</div>
);
}
Expand Down