Type: bug
Platform: mobile webview
Hi there,
Great work by all at Drifty on Ionic -- I love it. After updating to 1.2.1 from 1.1, tapping the nav bar to scroll to top does not work anymore. Here's the requisite codepen demonstrating the bug. Scroll down a bit, tap the nav bar and on 1.1, it scrolls to top, but on 1.2.1 it doesn't.
Working on getting a new update to my app out and noticed this. Thanks again and happy holidays.
Luke
@Ionitron :heart:
same problem here +1
The directive was commented out
https://github.com/driftyco/ionic/commit/cfa8042
Putting that line in fixes issue.
It looks like the intent was to allow native scrolling to kick-in, but still need to hookup the header 'tap' to scroll to top.
Hey, we removed that because it's non-standard and if you use the cordova-plugin-statusbar you'll get that for free, and it will actually work with the statusbar.
I'm open to adding it back, but I'm not sure we should be doing it. I need to be convinced :stuck_out_tongue:
Don't disagree, anyone can implement by providing on-tap themselves.
Would suggest updating the main doc page ion-header-bar and ion-nav-bar since the documented default is for this to happen. Guessing no-tap-scroll should just be removed?
My reasons for keeping are not strong enough
My resolution for browser platform: add a directive for class 'header-item'
angular
.module('app')
.directive('headerItem', ['$ionicScrollDelegate', function($ionicScrollDelegate) {
var directive = {
restrict: 'C',
link: function(scope, element, attr) {
element.bind('click', function() {
$ionicScrollDelegate.scrollTop(true);
});
}
};
return directive;
}]);
Most helpful comment
My resolution for browser platform: add a directive for class 'header-item'