Next.js Discord

Discord Forum

Next 14 internal #links not working in android with smooth scroll

Unanswered
Thrianta posted this in #help-forum
Open in Discord
ThriantaOP
Unable to scroll to nav linked items on Android devices in chrome (not tested other browsers). Works fine on iphones. Tested on browser stack and personal devices.

Developed a simple single page site, with a number of content sections. I've created a mobile menu that links to these sections using the Next Link component.

<ul id="menu" className="nav_items" role="menu" aria-labelledby="navcheckbox">
   <li className="nav_item" role="menuitem">
      <Link to="about">
      About
      </Link>
   </li>
   <li className="nav_item" role="menuitem">
      <Link to="services">
      Services
      </Link>
   </li>
   <li className="nav_item" role="menuitem">
      <Link to="contact">
      Contact
      </Link>
   </li>
</ul>


I want smooth scrolling to be in place across all devices.

I've tried replacing Link component with tags, no fix.

I've tried replacing Links components with react-scroll js library Link components, no fix.

Removing scroll-behaviour smooth enables you to jump between sections using the nav in Android devices, but you obviously don't get the smooth scroll.

Unsure why I cant resolve something so simple. Been reading into Link scroll conflicts with smooth scroll, but surely Next would have sorted this by v14.

0 Replies