ScrollTop/Bottom within a modal


#1

Is there a way to use scrollTop or scrollBottom within a modal window with along list. If you just put $ionicScrollDelegate.scrollTop(true) it gets applied to the main view the modal window belongs to.


#2

You need to use the delegate-handle.

<ion-content delegate-handle="modalContent" >
$ionicScrollDelegate.$getByHandle('modalContent').scrollTop(true);

See this example :

FYI : Ideally, tapping on the modal’s header would cause the list in the modal to scrollTop automatically. I’ve opened Issue #1329 for this : https://github.com/driftyco/ionic/issues/1329


#3

FYI : This is fixed in the nightlies.