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

chore(TextField): Narrow types for Events on TextField #2671

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

feclist
Copy link
Contributor

@feclist feclist commented Dec 20, 2024

Noticed that we can narrow the types of the event parameters on the on.. props for the TextField. This makes it trivial to access the value of the input element instead of having to cast it first.

@feclist feclist requested a review from a team as a code owner December 20, 2024 11:21
Copy link
Contributor

@YossiSaadi YossiSaadi left a comment

Choose a reason for hiding this comment

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

Hey @feclist, thanks for creating this PR!

While this improves type safety and makes accessing the value property easier without casting, it is considered a breaking change because existing implementations using broader event types may no longer compile. Consumers will need to update their event handler signatures to comply with the new typing.

So unfortunately, for now, we cannot merge it. We will definitely add a task for our next major, though.

@feclist
Copy link
Contributor Author

feclist commented Dec 23, 2024

Fair enough, will do a typecast for now in my code. Looking forward to the major release 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants