Skip to content

Commit

Permalink
feat(popover): add height auto for safari and remove ability to scrol…
Browse files Browse the repository at this point in the history
…l on backdrop

references #5420
  • Loading branch information
brandyscarney committed May 25, 2016
1 parent 4db72cf commit 620b7c8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/components/popover/popover.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ ion-popover {
ion-page {
position: relative;
display: flex;
height: auto;
}
}

Expand Down
9 changes: 6 additions & 3 deletions src/components/popover/popover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class Popover extends ViewController {
@Component({
selector: 'ion-popover',
template:
'<div disable-activated class="backdrop" (click)="bdClick()" [class.hide-backdrop]="!d.showBackdrop"></div>' +
'<div class="backdrop" (touchmove)="bdTouch($event)" (click)="bdClick($event)" [class.hide-backdrop]="!d.showBackdrop" disable-activated tappable role="presentation"></div>' +
'<div class="popover-wrapper">' +
'<div class="popover-arrow"></div>' +
'<div class="popover-content">' +
Expand Down Expand Up @@ -125,6 +125,11 @@ class PopoverCmp {
return this._viewCtrl.dismiss(null, role);
}

bdTouch(ev) {
ev.preventDefault();
ev.stopPropagation();
}

bdClick() {
if (this.isEnabled() && this.d.enableBackdropDismiss) {
this.dismiss('backdrop');
Expand Down Expand Up @@ -269,7 +274,6 @@ class PopoverMdPopIn extends PopoverTransition {
super(opts);

let ele = enteringView.pageRef().nativeElement;
this.positionView(ele, opts.ev);

let wrapper = new Animation(ele.querySelector('.popover-wrapper'));

Expand Down Expand Up @@ -317,7 +321,6 @@ class PopoverWpPopIn extends PopoverTransition {
super(opts);

let ele = enteringView.pageRef().nativeElement;
this.positionView(ele, opts.ev);

let wrapper = new Animation(ele.querySelector('.popover-wrapper'));

Expand Down
3 changes: 3 additions & 0 deletions src/components/popover/test/basic/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,8 @@
<button (click)="presentListPopover($event)">
<ion-icon name="more"></ion-icon>
</button>
<button (click)="presentLongListPopover($event)">
<ion-icon name="search"></ion-icon>
</button>
</ion-buttons>
</ion-toolbar>

0 comments on commit 620b7c8

Please sign in to comment.