-
Notifications
You must be signed in to change notification settings - Fork 939
fix(Input/InputNumber/Textarea): make modelModifiers generic
#5361
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
Conversation
commit: |
|
@benjamincanac added screenshots with an example |
|
Oh, this is a nice one! At first glance everything seems alright, but I'll be home tomorrow evening to properly double-check |
|
I haven't been able to play with this PR yet, but something was feeling off and tested it in a typescript playground to double check it, and found what it was: Doing a nullable?: null extends T ? true : neverYou can also check this typescritp playground But for some unknown reasons to me Vue seems to break with |
sandros94
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
As of now I would merge it like this, then if I ever understand what causes optional to break I will either create a new PR or report upstream (if it is something related to vue-tsc or whatever). Because even in a Vue playground it seems to work just fine...
|
@sandros94 I'm not sure if it's relevant, but if you set exactOptionalPropertyTypes: true in playground/nuxt/tsconfig, then the optional modifier will work nicely. It seems that without it, undefined is excluded from the generic type since model-value is already an optional prop. |
@vlaaadislav that could explain it, which in that case I would leave it as is anyway |
modelModifiers generic
π Linked issue
None
β Type of change
π Description
Adds more typing
π Checklist