Skip to content

Commit

Permalink
fix(app-root): async disable-scroll is cancelled properly
Browse files Browse the repository at this point in the history
references #9367
  • Loading branch information
manucorporat committed Nov 26, 2016
1 parent 5ff7072 commit 177a089
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/components/app/app-root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,20 @@ export class IonicApp extends Ion implements OnInit {
* @private
*/
_disableScroll(shouldDisableScroll: boolean) {
console.log('App Root: Scroll Disable Assist', shouldDisableScroll);

if (shouldDisableScroll) {
this.stopScroll().then(() => {
this._rafId = nativeTimeout(() => this.setElementClass('disable-scroll', true), 16 * 2);
this._rafId = nativeTimeout(() => {
console.debug('App Root: adding .disable-scroll');
this.setElementClass('disable-scroll', true);
}, 16 * 2);
});
} else {
cancelAnimationFrame(this._rafId);
let plugin = this._stopScrollPlugin;
if (plugin && plugin.cancel) {
plugin.cancel();
}
clearTimeout(this._rafId);
console.debug('App Root: removing .disable-scroll');
this.setElementClass('disable-scroll', false);
}
}
Expand Down

3 comments on commit 177a089

@mrthetkhine
Copy link

@mrthetkhine mrthetkhine commented on 177a089 Mar 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bug fix is not merged into Ionic 2 final release and bug still occur for Iphone 5 and 5s.

@Vivek-abstract
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bug is still present

@ShanmugapriyaDurairaj
Copy link

@ShanmugapriyaDurairaj ShanmugapriyaDurairaj commented on 177a089 Mar 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It got working now. After we changed below lines
change
_this.setElementClass('disable-scroll', true);
to
_this.setElementClass('disable-scroll', false);

in following path file
\node_modules\ionic-angular\components\app\app-root.js.

Please sign in to comment.