Skip to content

Commit 488bd5c

Browse files
committed
fix(ionContent): make scrollable content work as child of non-scrollable
Closes #1421
1 parent 37d0627 commit 488bd5c

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

js/angular/directive/content.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ function($timeout, $controller, $ionicBind) {
7979
$onScroll: '&onScroll',
8080
$onScrollComplete: '&onScrollComplete',
8181
hasBouncing: '@',
82-
scroll: '@',
8382
padding: '@',
8483
hasScrollX: '@',
8584
hasScrollY: '@',
@@ -96,7 +95,7 @@ function($timeout, $controller, $ionicBind) {
9695
});
9796
}
9897

99-
if ($scope.scroll === "false") {
98+
if ($attr.scroll === "false") {
10099
//do nothing
101100
} else if(attr.overflowScroll === "true") {
102101
$element.addClass('overflow-scroll');

test/unit/angular/directive/content.unit.js

+14
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,20 @@ describe('Ionic Content directive', function() {
7575
expect(scroll.length).toBe(0);
7676
});
7777

78+
it('should work scrollable with nested ionScroll elements', function() {
79+
var element = compile(
80+
'<ion-content scroll="false" class="content1">' +
81+
'<div>' +
82+
'<ion-content class="content2">' +
83+
'</ion-content>' +
84+
'</div>' +
85+
'</ion-content>')(scope);
86+
scope.$apply();
87+
88+
expect(jqLite(element[0].querySelector('.content2')).controller('$ionicScroll')).toBeTruthy();
89+
expect(element.controller('$ionicScroll')).toBeFalsy();
90+
});
91+
7892
it('should add padding classname to scroll element', function() {
7993
var element = compile('<ion-content padding="shouldPad"></ion-content>')(scope);
8094
var scroll = element.find('.scroll');

0 commit comments

Comments
 (0)