milosjanda / react-scroll-up

React component to add custom buttons for scrolling to top of page
MIT License
175 stars 28 forks source link

Conflict with scroll-behaviour:smooth in Next.js 13 with Tailwind CSS #46

Open emre-turan opened 1 year ago

emre-turan commented 1 year ago

I'm using the react-scroll-up package in a Next.js 13 application created with the app router, and it's working quite well. However, I've encountered an issue that I believe needs attention.

When I add a Tailwind CSS class for smooth scrolling in the HTML or include scroll-behaviour:smooth in the global.css within the body, the react-scroll-up package stops working.

Here's what I've tried:

I would appreciate any insights or solutions to this conflict, as it seems to be hindering the smooth integration of the package with Next.js 13 and Tailwind CSS.

BasselBlal commented 1 year ago

I have a similar issue with react 18 + tailwind css when setting scroll-behavior: smooth, after clicking the scroll button nothing happens, but when I trigger the mousewheel, the scroll begins. Any possible fixes for this?