question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: ion-popover doesnt have backdrop in tree-shaken build (react & vue)

See original GitHub issue

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

in production, tree-shaken build, (npm run build && npx serve -s build) popover are not dismissable by clicking on the backdrop. (no backdrop seems to show up) its also possible to scroll while the popup is open. I noticed this behavior when upgrading from v5 to v6

https://user-images.githubusercontent.com/24187269/146756242-067557e2-17e2-4596-8375-f79e56709606.mov

hosted production build: https://8179360d.ionic-popover-bug.pages.dev/

Expected Behavior

the backdrop should show up and it should be dismissable by clicking on it. it also shouldn’t be possible to scroll away while the popover is open. interestingly enough everything seems to work fine in dev mode (npm start)

https://user-images.githubusercontent.com/24187269/146757472-e6def746-9153-4377-9e10-ba1b37485a84.mov

Steps to Reproduce

The only step to reproduce is to use popover in any way with react ionic and build to production. just clone reproduction repo and create and serve a production build to encounter the issues.

Code Reproduction URL

https://github.com/JohnDeved/ionic-popover-bug

Ionic Info

Ionic:

   Ionic CLI       : 5.4.16 (/Users/undefined/.npm/_npx/864a9e3c2cd0cf50/node_modules/ionic)
   Ionic Framework : @ionic/react 6.0.1

Utility:

   cordova-res : not installed
   native-run  : not installed

System:

   NodeJS : v16.13.1 (/Users/undefined/.nvm/versions/node/v16.13.1/bin/node)
   npm    : 8.1.2
   OS     : macOS Big Sur

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
sean-perkinscommented, Dec 20, 2021

Hello @JohnDeved thanks for the issue! I have an open PR that addresses the issue.

The resolution affects both ion-modal and ion-popover; as inline overlay components were not defining their children custom elements in tree-shaken builds.

The Core team is mostly out on vacation/holidays for the remainder of the year and we won’t be pushing a new release of Ionic until after the New Year.

I’ve created a dev build if you’d like to confirm in your own projects:

npm install @ionic/react@6.0.1-dev.1640031995.c1d4978

I appreciate the reproduction application and notes; they were super helpful debugging the issue!

1reaction
halykoncommented, Dec 21, 2021

Hey @sean-perkins, I tried using the development build you provided, but it seems like I’m running into another error: image

I’ve updated @JohnDeved’s repo to use the dev build you provided. Also, https://6b1da293.ionic-popover-bug.pages.dev/ is a preview build (The actual error is only visible while running on the dev server though).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mobile Development with Ionic and Vue — Backdrop, Loading ...
In this article, we'll look at how to get started with mobile development with the Ionic framework with Vue. Backdrop. We can add...
Read more >
Popover doesn't show backdrop - Ionic Forum
Hi Ionites, I've been in a strange situation where my popover doesn't show backdrop.. Any idea? Thanks Html: <ion-header-bar ...
Read more >
Ionic Popover showBackdrop: true is not working
I am creating a new blank project using PopoverController, but the backdrop is not showing. This is my home.html: <ion-header> <ion-navbar> <ion ......
Read more >
@ionic/core | Yarn - Package Manager
Ionic is an open source app development toolkit for building modern, fast, top-quality cross-platform native and Progressive Web Apps from a single codebase ......
Read more >
Source - GitHub
[6.4.0](https://github.com/ionic-team/ionic-framework/compare/v6.3.10...v6.4.0) (2022-12-07) ... **react,vue:** backdrop for inline modal/popover overlay ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found