You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dmarsola-irdeto
changed the title
Replace_With_Component_Name: Brief_Bug_Description
Chart property "onMouseDown" not typed
May 13, 2024
melloware
added
Typescript
Issue or pull request is *only* related to TypeScript definition
and removed
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
labels
May 13, 2024
melloware
added a commit
to melloware/primereact
that referenced
this issue
May 13, 2024
Describe the bug
We're using the chart property "onMouseDown" to prevent click propagation like this:
onMouseDown={(event: React.MouseEvent): void => {
event.stopPropagation()
}}
It works as intended, but it is not typed as part of the components attributes.
Note that "onTouchStart" does not show a typescript error as "onMouseDown" does
PrimeReact version
10.1.1
React version
18.x
Language
TypeScript
Build / Runtime
Next.js
Browser(s)
No response
Steps to reproduce the behavior
Add onMouseDown as a Chart component property.
Typescript complains that it is not a property of the component.
<Chart
data={data}
type="doughnut"
options={options}
onMouseDown={(event: React.MouseEvent): void => { // error
event.stopPropagation()
}}
onTouchStart={(event: React.TouchEvent): void => { // no error
event.stopPropagation()
}}
/>
Expected behavior
No typescript error is displayed in the IDE.
The text was updated successfully, but these errors were encountered: