Topic: sideNav touch scroll

mioopioo pro asked 5 years ago


Hi guys, I have a problem with pro version of latest MDB 4.8.10. sideNav can not be scrolled on touch devices when content is higher than viewport.

Please check this snippet on some touch device to see current wrong behavior. In 4.8.0 everything was good.


Marta Wierzbicka staff answered 5 years ago


Hi,

add these lines of code to your JavaScript section: var sideNavScrollbar = document.querySelector('.custom-scrollbar'); var ps = new PerfectScrollbar(sideNavScrollbar);. Like in our documentation here: https://mdbootstrap.com/docs/jquery/navigation/sidenav/#basicUsage and in my snippet forkend from yours: https://mdbootstrap.com/snippets/jquery/marta-szymanska/1217041. It will work then.

Best, Marta


mioopioo pro commented 5 years ago

Thanks Marta, I forgot that I have multiple side-nav elements on page, so the workaround is (JQuery version):

var ps; $('.custom-scrollbar').each(function() { ps = new PerfectScrollbar($(this).get(0)); });


Marta Wierzbicka staff commented 5 years ago

OK, thank you for your workaround.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.8.10
  • Device: any touch device
  • Browser: chrome, safari
  • OS: Android, iOS
  • Provided sample code: No
  • Provided link: Yes