htmlstreamofficial / preline

Preline UI is an open-source set of prebuilt UI components based on the utility-first Tailwind CSS framework.
https://preline.co
Other
4.9k stars 309 forks source link

Nextjs preloading causes Scrollspy plugin to fail #78

Closed indomitableXiaoNan closed 1 year ago

indomitableXiaoNan commented 1 year ago

In nextjs, if the pre loaded page contains the Scrollspy plugin, entering the pre loaded page will cause the Scrollspy plugin to have no scrolling animation and its active state to become invalid

indomitableXiaoNan commented 1 year ago

To add:

Using nextjs13.4, the Link component prefetch parameter defaults to true. The page that is redirected through Link includes the scrollspy plugin. After clicking Link to redirect to the page, the scrollspy's active and scrolling animation states are invalid. After F5 refreshes the page, it returns to normal. After setting prefetch to false, the Link redirected page can also return to normal.

olegpix commented 1 year ago

To add:

Using nextjs13.4, the Link component prefetch parameter defaults to true. The page that is redirected through Link includes the scrollspy plugin. After clicking Link to redirect to the page, the scrollspy's active and scrolling animation states are invalid. After F5 refreshes the page, it returns to normal. After setting prefetch to false, the Link redirected page can also return to normal.

Could you upload your code to some public service (replit, stackblitz, codepen)? We will check the error and come back to you with an answer.

jahaganiev commented 1 year ago

@indomitableXiaoNan Closing this issue for the moment. Once you've got a test link with the source code, please feel free to open a new issue. Thanks!