In my application, I use a button to display a popover from another page.
The popover is centered both horizontally and vertically in the window, which causes it to extend beyond the window if it is too tall.
Is there a way to better adjust the vertical position of the popover?
I have tried using the properties popover.side, popover.alignment, popover.reference, and popover.keepContentsMounted, but I have not seen any change in behavior.
This is the code for the button
async columnSelect() {
const popover = await this.popoverController.create({
component: ColumnSelectComponent,
componentProps: {
columns: this.columns,
allColumns: this.allColums,
},
backdropDismiss: true,
translucent: true,
});
popover.style.cssText = '--min-width: 300px;';
await popover.present();
await popover.onWillDismiss();
this.columns = this.varServ.popoverValue;
}
This is the css for the popover
.sc-ion-select-popover {
padding-top: 0 !important;
padding-bottom: 0 !important;
margin: 0 !important;
--inner-border-width: 0;
}
ion-popover .popover-viewport {
display: contents;
}
.popover-viewport .popover-content {
top: 50% !important;
left: 50% !important;
transform: translate(-50%, -50%) !important;
}
This is how the popover is show