-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Type Mismatch in Generated Props for onInput and onChange Methods with Element Plus Integration #4637
Closed
2 of 5 tasks
Labels
👕 TypeScript
TypeScript typings issue
Comments
logaretm
added a commit
that referenced
this issue
Jan 28, 2024
Thanks for reporting this, this makes sense. While there is no good way to type this without using |
logaretm
added a commit
that referenced
this issue
Jan 28, 2024
This was referenced Jun 26, 2024
This was referenced Sep 12, 2024
This was referenced Sep 20, 2024
This was referenced Oct 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What happened?
In the latest update of vee-validate, the defineField function has been introduced to define form fields and generate props for input elements. However, the types of the onInput and onChange methods in the generated props are strictly typed to accept only an Event object as their argument.
Expected Behavior:
In some UI libraries, such as Element Plus (ElInput), the onInput and onChange methods expect the first argument to be the input value, not an Event object. This results in TypeScript errors when trying to use the generated props with these input components.
Suggested Solution:
To make vee-validate more flexible and compatible with various UI libraries, it would be helpful to allow the onInput and onChange methods in the generated props to accept both an Event object and the input value as arguments. This would accommodate different use cases and prevent TypeScript errors when using vee-validate with libraries like Element Plus.
Reproduction steps
defineField
function, for example:titleProps
with an Element PlusElInput
component, like this:onInput
andonChange
methods. Element Plus expects the first argument of these methods to be the input value, not anEvent
object.Version
Vue.js 3.x and vee-validate 4.x
What browsers are you seeing the problem on?
Relevant log output
No response
Demo link
Code of Conduct
The text was updated successfully, but these errors were encountered: