3

I have an Ionic 4 Popover on a button on the bottom of the screen. When I click the button to open the popover, it appears off-screen underneath...

.html

<div class="TabBarItem" (click)="popover($event)"> <label>Tab Item</label> </div> 

.ts

 function popover(ev) { this.popoverController .create({ component: PopoverComponent, event: ev, translucent: true, }) .then(el => { el.present(); }); } 

Result...

enter image description here

Is there a way to fix this, or manually reposition it?

1

1 Answer 1

7

Turns out all I had to do is add <ion-content> to my popover component. This fixed the issue.

Sign up to request clarification or add additional context in comments.

2 Comments

In my case, I had an *ngIf at the ion-content element. Moving the *ngIf to an inner element solved the problems. Seems the ion-content wasn't already there when the popover is rendered.
That was it for me too, standard div doesn't play nicely with ionic's positioning near the screen edge

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.