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

IonicRefresher event not working #30178

Closed
shinhagunn opened this issue Feb 5, 2025 · 11 comments · Fixed by #30227
Closed

IonicRefresher event not working #30178

shinhagunn opened this issue Feb 5, 2025 · 11 comments · Fixed by #30227
Labels

Comments

@shinhagunn
Copy link

I initialized a new project using ionic CLI and then copied the IonRefesher example code and ran it but it seems the event is not triggered.
When I pull down, the loading spinner appears, but after 2 seconds it doesn't automatically hidden but keeps spinning.
The desired result should be: log 123 and hidden loading

Here is Page.vue

<ion-page>
  <ion-header>
    <ion-toolbar>
      <ion-title>Pull to Refresh</ion-title>
    </ion-toolbar>
  </ion-header>

  <ion-content class="ion-padding">
    <ion-refresher slot="fixed" @ion-refresh="handleRefresh($event)">
      <ion-refresher-content></ion-refresher-content>
    </ion-refresher>

    <p>Pull this content down to trigger the refresh.</p>
  </ion-content>
</ion-page>

<script setup lang="ts">
import { IonPage, IonHeader, IonToolbar, IonTitle, IonContent, IonRefresher, IonRefresherContent } from '@ionic/vue';

const handleRefresh = (event: CustomEvent) => {
  console.log('123')
  setTimeout(() => {
    // Any calls to load data go here
    event.target.complete();
  }, 2000);
};
</script>

My package.json:

"dependencies": {
    "@capacitor/app": "7.0.0",
    "@capacitor/core": "7.0.1",
    "@capacitor/haptics": "7.0.0",
    "@capacitor/keyboard": "7.0.0",
    "@capacitor/status-bar": "7.0.0",
    "@ionic/vue": "^8.0.0",
    "@ionic/vue-router": "^8.0.0",
    "ionicons": "^7.0.0",
    "vue": "^3.3.0",
    "vue-router": "^4.2.0"
  },
  "devDependencies": {
    "@capacitor/cli": "7.0.1",
    "@vitejs/plugin-legacy": "^5.0.0",
    "@vitejs/plugin-vue": "^4.0.0",
    "@vue/eslint-config-typescript": "^12.0.0",
    "@vue/test-utils": "^2.3.0",
    "cypress": "^13.5.0",
    "eslint": "^8.35.0",
    "eslint-plugin-vue": "^9.9.0",
    "jsdom": "^22.1.0",
    "terser": "^5.4.0",
    "typescript": "~5.6.2",
    "vite": "~5.2.0",
    "vitest": "^0.34.6",
    "vue-tsc": "^2.1.10"
  }
@ionitron-bot ionitron-bot bot added the triage label Feb 5, 2025
@dimer47
Copy link

dimer47 commented Feb 5, 2025

Hello,

I confirm the bug reported by [shinhagunn](https://github.com/shinhagunn). Since the new 8.4.3 release, the IonicRefresher no longer works on my Vue.js project. Reverting to version 8.4.2 fixes the issue without any problem.

I hope this helps in identifying the source of the problem,
I remain available if needed.

@shinhagunn
Copy link
Author

Only revert "@ionic/vue" and "@ionic/vue-router" right ?

@dimer47
Copy link

dimer47 commented Feb 5, 2025

Only revert @ionic/vue package.

@shinhagunn
Copy link
Author

It's working, thanks sir

@dimer47
Copy link

dimer47 commented Feb 5, 2025

The issue should not have been closed to allow the team to work on the fix. Could you please reopen the issue? Thank you.

@shinhagunn shinhagunn reopened this Feb 8, 2025
@shinhagunn
Copy link
Author

sorry about late

@chris-si
Copy link

chris-si commented Feb 9, 2025

I can also confirm the same behavior. v8.4.3unfortunately breaks the IonRefresher.

@tespheakdeyesoftix
Copy link

Hi,
I also have this issue in my project latest version, hope this problem resolve asap.

Thank

@martinclaus1
Copy link

I can also confirm that 8.4.3 breaks the IonRefresher.

@progcode
Copy link

same here too with 8.4.3

@yuricoco
Copy link

yuricoco commented Mar 8, 2025

I've fixed @ionic/vue to 8.4.2 and it works now thx

github-merge-queue bot pushed a commit that referenced this issue Mar 11, 2025
Issue number: resolves #30206 resolves #30178 resolves #30177 resolves
#30175 resolves #30170

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
There have been plenty of issues reported in regards to Vue components
failing to propagate events. It seems like when we updated the Vue
output target and started to use the provided runtime code from the
output target, we have changed the way how event names are computed.
Ionic has used a custom wrapper for handling events that would kebab
case event names. That is no longer needed and removing it fixes
observed issues.

Reproduction case working:
https://stackblitz.com/edit/vj18czas-wdhzxjom?file=package.json

## What is the new behavior?
We have received a fix for this in
stenciljs/output-targets#617 which I hope will
resolve this issue by updating the dependency.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer
for more information.
-->


## Other information

Dev build: `8.4.4-dev.11741193800.14916f6f`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants