admin管理员组文章数量:1025560
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.
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.
本文标签: nextjsOneTrust Cookie Settings Link Scrolling Page To TopStack Overflow
版权声明:本文标题:next.js - OneTrust Cookie Settings Link Scrolling Page To Top - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745611884a2159048.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论