Skip to content

fix(ion-backdrop): new ion-backdrop can prevent background scrolling - #6687

Merged
brandyscarney merged 1 commit into
ionic-team:2.0from
manucorporat:fix-backdrop
Jun 2, 2016
Merged

brandyscarney merged 1 commit into
ionic-team:2.0from
manucorporat:fix-backdrop

Conversation

@manucorporat

@manucorporat manucorporat commented May 28, 2016 •

Copy link
Copy Markdown
Contributor

Short description of what this resolves:

New ion-backdrop component can prevent background scrolling fixing: #6656 in Alerts, Popover, actionsheet, loading...

Changes proposed in this pull request:

  • Replace all <div class="backdrop" ...> with <ion-backdrop>

  • MenuBackdrop is not longed needed

  • We don't longer have to listen for touchmove events!! performant solution

  • Backdrop injects a class at body level in order to prevent scrolling:

    body.stop-scroll scroll-content {
    overflow-y: hidden;
    overflow-x: hidden;
    }

Bonus: this code was repeated all over the place, now it is much more compact.

Before:

<div (click)="bdClick()" tappable disable-activated class="backdrop" role="presentation"></div>

After:

<ion-backdrop (click)="bdClick()"></ion-backdrop>

Ionic Version: 2.x

Fixes: #6656

@adamdbradley

Copy link
Copy Markdown
Contributor

@manucorporat How does this perform on slow Android during a transition? My concern is modifying the body element, which causes a repaint on the entire app, so it may occasionally add a flicker. Overall I think it's a great solution, just want to double check first that slow Android doesn't have a flicker.

@manucorporat

Copy link
Copy Markdown
Contributor Author

@adamdbradley on device iOS even in a slow UIWebView I didn't notice any flicker, on android I didn't tried... BUT! if this is a iOS only issue, we may don't have to modify the body on android... right?

I can do some quick research today.

@manucorporat
manucorporat force-pushed the fix-backdrop branch 4 times, most recently from 77aab0d to 7034be9 Compare May 31, 2016 21:48
@brandyscarney brandyscarney self-assigned this Jun 2, 2016
@brandyscarney
brandyscarney merged commit 4af5e03 into ionic-team:2.0 Jun 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants