You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(sidenav): Scroll locking and jumpy for md-sidenav content on iOS (Safari) #5606
@YeomansIII this is a general problem of scrolling an element with overflow: auto on iOS devices.
The problem arises when trying to scroll an element with scrollable content that currently has scrollTop = 0 in the direction that does not reveal further content. In that case, the browser will try to scroll the entire page and will handle this scrolling interaction until no further user input is received.
A way to solve this issue is by listening to the touchmove event and in case the move direction is "wrong", i.e. in the direction with no further content, the event has to be cancelled with Event.preventDefault()
On my end it is working 90% correctly. The only one case, when I run into issue with scrolling side-nav layout in ios, is when using dynamically added content:
I'm working on #6712 which will allow the sidenav to be put in fixed position mode, that way you can just let the body scroll naturally and not use overflow:auto and the fixed position sidenav will remain in place
Activity
macjohnny commentedon Jul 13, 2017
@YeomansIII this is a general problem of scrolling an element with
overflow: autoon iOS devices.The problem arises when trying to scroll an element with scrollable content that currently has
scrollTop = 0in the direction that does not reveal further content. In that case, the browser will try to scroll the entire page and will handle this scrolling interaction until no further user input is received.A way to solve this issue is by listening to the
touchmoveevent and in case the move direction is "wrong", i.e. in the direction with no further content, the event has to be cancelled withEvent.preventDefault()maciejtreder commentedon Jul 19, 2017
On my end it is working 90% correctly. The only one case, when I run into issue with scrolling side-nav layout in ios, is when using dynamically added content:
tiancovici commentedon Jul 29, 2017
Seeing same issue on iOS.
On startup, content in sidenav is locked. Navbar isn't.
I can click on the content, but it's not scrollable. Only when I click on the content (and on click) it jumps to their page, it becomes scrollable.
Is there a workaround?
I'll try the touchmove, but was wondering maybe there was a styling approach or an on init force this view so it works approach
aleixsuau commentedon Sep 1, 2017
Hi, same issue here. Any clue @mmalerba ?
Thanks
mmalerba commentedon Sep 1, 2017
I'm working on #6712 which will allow the sidenav to be put in fixed position mode, that way you can just let the body scroll naturally and not use overflow:auto and the fixed position sidenav will remain in place
aleixsuau commentedon Sep 4, 2017
Hi @mmalerba ,
I've found that in my case the cause of the problem was bind to Hammer events:
If I remove swiperight and swipeleft events, scroll is not blocked anymore.
mmalerba commentedon Nov 21, 2017
sidenav now supports fixed position mode, documentation was added in #7775
angular-automatic-lock-bot commentedon Sep 7, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.