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: popover select does not work in @ionic/[email protected]+ #26695

Closed
4 of 8 tasks
aparajita opened this issue Jan 29, 2023 · 3 comments · Fixed by #26694
Closed
4 of 8 tasks

bug: popover select does not work in @ionic/[email protected]+ #26695

aparajita opened this issue Jan 29, 2023 · 3 comments · Fixed by #26694
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@aparajita
Copy link

aparajita commented Jan 29, 2023

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • v7.x
  • Nightly

Current Behavior

When I click on a select that is configured as a popover, there is a runtime error and the popover does not appear.

Error:

Uncaught (in promise) TypeError: Invalid value used as weak map key
    at WeakMap.set (<anonymous>)
    at Object.attachViewToDom (@ionic_vue.js?v=95484b8b:22026:12)
    at attachComponent (@ionic_vue.js?v=95484b8b:4456:21)
    at proxyCustomElement.hasController.present (@ionic_vue.js?v=95484b8b:5590:31)
    at proxyCustomElement.disabled.open (@ionic_vue.js?v=95484b8b:14363:19)

Expected Behavior

There should be no error.

Steps to Reproduce

Open the stackblitz and click on the popover. Then open the console and view the error.

Code Reproduction URL

https://stackblitz.com/edit/angular-ysm5ef

Ionic Info

Ionic:

Ionic CLI : 6.20.8 (@Ionic[email protected]/node_modules/@ionic/cli)
Ionic Framework : @ionic/vue 6.5.1 (@Ionic[email protected]/node_modules/@ionic/vue)

Capacitor:

Capacitor CLI : 4.6.2
@capacitor/android : 4.6.2 (@capacitor+android@4.6.2_@capacitor[email protected]/node_modules/@capacitor/android)
@capacitor/core : 4.6.2 (@capacitor[email protected]/node_modules/@capacitor/core)
@capacitor/ios : 4.6.2 (@capacitor+ios@4.6.2_@capacitor[email protected]/node_modules/@capacitor/ios)

Utility:

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

System:

NodeJS : v19.5.0
npm : 9.3.1
OS : macOS Monterey

Additional Information

I'm seeing this in both Brave and Firefox, M1 MBP.

The cause:

  • popover.js#present calls attachComponent, passing the string 'ion-select-popover' as the component argument.
  • attachComponent calls attachViewToDom, which tries to use that string as the key to a weak map, which doesn't work.
@ionitron-bot ionitron-bot bot added the triage label Jan 29, 2023
@aparajita
Copy link
Author

FYI, I did some testing with earlier versions and the bug appeared in 6.4.

@aparajita aparajita changed the title bug: bug: popover select does not work in @ionic/[email protected]+ Jan 29, 2023
@liamdebeasi liamdebeasi added package: core @ionic/core package type: bug a confirmed bug report labels Jan 30, 2023
@liamdebeasi
Copy link
Contributor

Thanks! Here is a dev build with a proposed fix if you are interested in testing: 6.5.2-dev.11674852369.1c9fe737

@ionitron-bot
Copy link

ionitron-bot bot commented Mar 1, 2023

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 Mar 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants