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: no difference between ionChange and ionInput #25715

Closed
4 of 7 tasks
wendt88 opened this issue Aug 4, 2022 · 2 comments
Closed
4 of 7 tasks

bug: no difference between ionChange and ionInput #25715

wendt88 opened this issue Aug 4, 2022 · 2 comments
Labels

Comments

@wendt88
Copy link

wendt88 commented Aug 4, 2022

Prerequisites

Ionic Framework Version

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

Current Behavior

<ion-input
    v-model="foo"
    type="text"
    @ionInput="onInput" <!-- gets called on input -->
    @ionChange="onChange" <!-- gets called on input too -->
/>

Expected Behavior

ionChange should be called on input blur only

Steps to Reproduce

<template>
    <ion-input
        v-model="foo"
        type="text"
        @ionInput="onInput"
        @ionChange="onChange"
    />
</template>
<script lang="ts">
import {defineComponent, ref,} from 'vue';
import {IonInput} from '@ionic/vue';
export default defineComponent({
  components: {
    IonInput
  },
  setup() {
    return {
      foo: ref(''),
      onInput: () => console.log('input'),
      onChange: () => console.log('change')
    }
  }
});
</script>

Code Reproduction URL

No response

Ionic Info

Ionic:

Ionic CLI : 6.19.1
Ionic Framework : @ionic/vue 6.1.11

Capacitor:

Capacitor CLI : 3.6.0
@capacitor/android : 3.6.0
@capacitor/core : 3.6.0
@capacitor/ios : 3.6.0

Utility:

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

System:

NodeJS : v16.14.2
npm : 8.12.2
OS : Windows 10

Additional Information

this works fine:

const input = document.getElementsByTagName('input')[0];
input.addEventListener('change', console.log)
input.addEventListener('input', console.log)
@ionitron-bot ionitron-bot bot added the triage label Aug 4, 2022
@liamdebeasi liamdebeasi self-assigned this Aug 4, 2022
@liamdebeasi
Copy link
Contributor

Thanks for the issue. This is a behavior we are looking to change for Ionic 7. In short, we would like to make Ionic's ionChange event more like the change event for native <input> elements. We have an RFC with the proposed changes available at the following link if you are interested in providing feedback: #25532

I am going to merge this thread with #19651. This is where we are tracking changes to ionChange. Please follow that thread for updates. Thanks!

@liamdebeasi liamdebeasi closed this as not planned Won't fix, can't repro, duplicate, stale Aug 4, 2022
@liamdebeasi liamdebeasi removed their assignment Aug 4, 2022
@ionitron-bot
Copy link

ionitron-bot bot commented Sep 3, 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 Sep 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants