next.js - OneTrust Cookie Settings Link Scrolling Page To Top - Stack Overflow

In a NextJS app(v13.5), clicking the OneTrust Cookie settings link in the footer triggers the page to s

In a NextJS app(v13.5), clicking the OneTrust Cookie settings link in the footer triggers the page to scroll to the top when the modal popup appears. After closing the modal, the page scrolls back down to the footer. Is there a way to prevent this behavior?

<a className="ot-sdk-show-settings">Cookie Settings</a>

I replaced the anchor tag with button, div, and span elements, and tried using e.preventDefault() on the click and captured the scrollY position to prevent scrolling, but no luck so far.

Any assistance would be greatly appreciated.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745611885a4635993.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信