79631954

Date: 2025-05-21 12:21:40
Score: 0.5
Natty:
Report link

It's an old one but I was facing this problem some days ago and I finally found a solution.

Tested with Ionic 8 + Vue 3

Full example here : https://codesandbox.io/p/devbox/ztvy68

<ion-button id="custom-popover-trigger">Background clickable popover</ion-button>
<ion-popover
    ref="customPopover"
    class="custom-popover"
    :show-backdrop="false"
    :backdrop-dismiss="false"
    trigger="custom-popover-trigger"
    :dismiss-on-select="true"
    @didPresent="autoHidePopoverAfter3seconds"
>
  <ion-content>Hi there !</ion-content>
</ion-popover>
/* Trick to keep background focus */
ion-popover.custom-popover{
  position: unset;
  &::part(backdrop) {
    display: none;
    pointer-events: none;
  }
}
Reasons:
  • Blacklisted phrase (0.5): Hi there
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Tatayoyoh