Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
4 of 6 tasks
JohnDeved opened this issue Dec 20, 2021 · 9 comments
Closed
4 of 6 tasks
Labels
package: react @ionic/react package type: bug a confirmed bug report v6 issues specific to Framework v6

Comments

@JohnDeved
Copy link

JohnDeved commented Dec 20, 2021

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

Screen.Recording.2021-12-20.at.11.52.13.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)

Screen.Recording.2021-12-20.at.12.01.22.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

@ionitron-bot ionitron-bot bot added the holiday triage issues that were created during holiday period label Dec 20, 2021
@ionitron-bot
Copy link

ionitron-bot bot commented Dec 20, 2021

Thanks for the issue! This issue has been labeled as holiday triage. With the winter holidays quickly approaching, much of the Ionic Team will soon be taking time off. During this time, issue triaging and PR review will be delayed until the team begins to return. After this period, we will work to ensure that all new issues are properly triaged and that new PRs are reviewed.

In the meantime, please read our Winter Holiday Triage Guide for information on how to ensure that your issue is triaged correctly.

Thank you!

@sean-perkins
Copy link
Contributor

sean-perkins commented Dec 20, 2021

I believe this is a result of nested custom elements not being defined in overlays. This has been resolved here #24439 and will be available in the next release of Ionic.

@sean-perkins
Copy link
Contributor

Looks like this is a similar issue, but not resolved with the mentioned PR. I'll track this as a bug in v6.

The ion-backdrop custom element isn't being defined with the production build.

@sean-perkins sean-perkins added package: react @ionic/react package type: bug a confirmed bug report v6 issues specific to Framework v6 labels Dec 20, 2021
@ionitron-bot ionitron-bot bot removed the holiday triage issues that were created during holiday period label Dec 20, 2021
@sean-perkins sean-perkins self-assigned this Dec 20, 2021
@sean-perkins
Copy link
Contributor

sean-perkins commented 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!

@sean-perkins sean-perkins removed their assignment Dec 20, 2021
@JohnDeved
Copy link
Author

JohnDeved commented Dec 20, 2021

@sean-perkins thank you so much for tackling this issue, very quick and good work 👍

@halykon
Copy link

halykon commented 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).

@JohnDeved JohnDeved changed the title bug: ion-popover doesnt have backdrop in production build (react) bug: ion-popover doesnt have backdrop in tree-shaken build (react) Dec 24, 2021
@meddario
Copy link

Hi, the same also seems to happen with the vue.js version, "@ionic/vue": "^6.0.0", (actual version 6.0.1). Popovers have no backdrop with the production build.

@meddario
Copy link

meddario commented Jan 1, 2022

Here a reproducer for the vue.js version. The README.md contains the instructions to reproduce the problem.

Let me kwow if I need to open a separate issue.

ionic-vue-popover-backdrop.zip

@JohnDeved JohnDeved changed the title bug: ion-popover doesnt have backdrop in tree-shaken build (react) bug: ion-popover doesnt have backdrop in tree-shaken build (react & vue) Jan 3, 2022
@ionitron-bot
Copy link

ionitron-bot bot commented Feb 6, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Feb 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: react @ionic/react package type: bug a confirmed bug report v6 issues specific to Framework v6
Projects
None yet
Development

No branches or pull requests

4 participants