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

Add onInput callback #674

Closed
wants to merge 1 commit into from
Closed

Add onInput callback #674

wants to merge 1 commit into from

Conversation

ankurk91
Copy link
Contributor

@ankurk91 ankurk91 commented Aug 8, 2018

Hi,

If you think #656 is too complicated and might be breaking for users then this PR might be helpful.

The PR will add another callback onInput which be called without checking for oldValue.
This will really help developers like me to port this awesome library to other js frameworks for example -
https://github.com/ankurk91/vue-jquery-mask

@igorescobar
Copy link
Owner

@ankurk91 thanks for your contribuition!

what's the difference between this and the native input event?

@ankurk91
Copy link
Contributor Author

ankurk91 commented Aug 8, 2018

The onInput callback will be called after this library has finished its internal calculations and then external javascript can perform actions like updating the v-model.

The native input event listener might be called before the library finished its internal processing.
The library is also listening to same input event

The onInput callback ensures that there is no pending task from the library and external javascript can proceed with value returned by callback.

@ankurk91 ankurk91 closed this Nov 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants