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

fix(forms): precise type assertion for onInput event handler #293

Merged
merged 4 commits into from Jun 15, 2023
Merged

fix(forms): precise type assertion for onInput event handler #293

merged 4 commits into from Jun 15, 2023

Conversation

selemondev
Copy link
Contributor

This commit updates the onInput event handler code. The type assertion in the code has been modified to cast event.target as HTMLInputElement instead of any. By using the specific HTMLInputElement type, we ensure accurate type checking and maintain type safety throughout the codebase. The event handler still emits the 'update:modelValue' event and updates the model value based on the input element's value. This modification enhances code clarity and provides more precise typing, leading to better code quality.

@vercel
Copy link

vercel bot commented Jun 14, 2023

@selemondev is attempting to deploy a commit to the Nuxt Labs Team on Vercel.

A member of the Team first needs to authorize it.

@benjamincanac
Copy link
Member

This might be worth replicating these changes in Textarea and Select components too.

@selemondev
Copy link
Contributor Author

This might be worth replicating these changes in Textarea and Select components too.

Done 🎉.

Copy link
Member

@benjamincanac benjamincanac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems your code formatter changed a lot of stuff in the Textarea component.

@selemondev
Copy link
Contributor Author

It seems your code formatter changed a lot of stuff in the Textarea component.

What do you suggest I do? Should I return the default layout of the input element of the Textarea component as was previously?

Copy link
Member

Yes you can revert these to only keep the type change I guess.

@selemondev
Copy link
Contributor Author

Yes you can revert these to only keep the type change I guess.

Done 🎉.

@benjamincanac benjamincanac changed the title fix(app): Precise type assertion for onInput event handler fix(forms): precise type assertion for onInput event handler Jun 15, 2023
@benjamincanac
Copy link
Member

Thanks 😊

@benjamincanac benjamincanac merged commit 5a31e79 into nuxt:dev Jun 15, 2023
1 of 2 checks passed
benjamincanac added a commit that referenced this pull request Jun 21, 2023
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
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.

None yet

2 participants