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: Ionic/vue 3.1 compat mode doesn’t respond to @click events

See original GitHub issue

Bug Report

Ionic version:

[ ] 4.x [x] 5.x

Current behavior:

@click events are not fired when vue.config.js includes config.resolve.alias.set("vue", "@vue/compat");

Expected behavior:

@click events should fire

Steps to reproduce:

Related code: A vanilla ionic start, upgrade to vue 3.1, add compat mode, and click events don’t fire ionic start myApp blank --type=vue

A sample application via GitHub https://github.com/inspire22/ionic-click-bug

I’d suspected that adding ion-* to isCustomElement might solve it, but it does not. It does work to put a div/span around the ionic element and move the click element handler to that.

Other information:

I created a thread in the forums first but didn’t hear anything so am adding a ticket. I’m sorry that my knowledge of vue/ionic isn’t enough to debug this further. https://forum.ionicframework.com/t/ionic-vue-3-1-compat-mode-doesnt-respond-to-click-events/211353

Ionic info:

Running on WSL 2 from windows 10 if it matters.

Ionic:

   Ionic CLI       : 6.12.2 (/usr/lib/node_modules/@ionic/cli)
   Ionic Framework : @ionic/vue 5.6.9

Utility:

   cordova-res (update available: 0.15.3) : 0.15.2
   native-run                             : not installed

System:

   NodeJS : v14.17.1 (/home/kevin/.nvm/versions/node/v14.17.1/bin/node)
   npm    : 7.17.0
   OS     : Linux 4.4
  ─────────────────────────────────────────────────

     Ionic CLI update available: 6.12.2 → 6.16.3
          Run npm i -g @ionic/cli to update
  ─────────────────────────────────────────────────

Thanks for a great project, I appreciate all the volunteers and staff that work on it.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
inspire22commented, Jul 1, 2021

It’s working great, thanks so much for your help 😃 I went ahead and updated my test app on github with the fix if anyone else runs into this. https://github.com/inspire22/ionic-click-bug

1reaction
inspire22commented, Jun 24, 2021

Thanks! Phew they shut that down fast lol, I’ll chime in with my 2c in case it helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ionic/vue 3.1 compat mode doesn't respond to @click events
I made a repository with a simple button that calls alert onclick. Once I enable config.resolve.alias.set("vue", "@vue/compat" in ...
Read more >
Vue 3.1 Compat mode @click does not work - Get Help
Hi everyone, I am running into an issue where @click handlers are not firing when using the compat mode in Vue 3.1 When...
Read more >
@ionic/core | Yarn - Package Manager
All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines. 6.3.10 (2022-12-07). Bug Fixes. datetime: ......
Read more >
Vue 3.2 - Hacker News
Vue doesn't have react style hooks, but the composition API fills a ... I can build mobile apps using Vue via Ionic Framework...
Read more >
The Dangers of Stopping Event Propagation - CSS-Tricks
This bug happens because the Bootstrap code responsible for closing the dropdown menu is listening for click events on the document. But since ......
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