-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Checkbox: prop onClick
changes the event type in 10.5.3
#6231
Checkbox: prop onClick
changes the event type in 10.5.3
#6231
Comments
Fix #6231: Checkbox typescript and onClick event
Looks like this is a still an issue in 10.6.3 |
@dvpritzbuer interested in helping with this one? The Checkbox Typescript def is definitely not correct. |
@melloware if it's not super urgent and next week would be fine for the PR I can have a look at it |
@dvpritzbuer much appreciated next week is fine! |
@melloware the change was made in #6109 and should be fine @datacampsis please try |
@melloware The problem is that the underlying react event with target always gets passed EventTarget as target property: So the only solution would be to add a specific definition for the onClick method again. Maybe you don't define an additional interface for that and just extend the CheckboxProps interface with |
@dvpritzbuer can you review my PR I think I got it right? |
@melloware |
Describe the bug
In version 10.5.0, the Checkbox's
onClick
event type was CheckboxClickEvent:Now is HtmlDivElement, and property
checked
not exists:Reproducer
https://stackblitz.com/edit/ovmva7?file=src%2FApp.tsx
PrimeReact version
10.5.3
React version
18.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
Expects the type CheckboxClickEvent and access the
checked
propThe text was updated successfully, but these errors were encountered: