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

Chart property "onMouseDown" not typed #6614

Closed
dmarsola-irdeto opened this issue May 13, 2024 · 1 comment · Fixed by #6618 or leoo1992/GeradorQRCode#40 · May be fixed by mtech-31-quemistry/quemistry_client_web#3
Closed

Chart property "onMouseDown" not typed #6614

dmarsola-irdeto opened this issue May 13, 2024 · 1 comment · Fixed by #6618 or leoo1992/GeradorQRCode#40 · May be fixed by mtech-31-quemistry/quemistry_client_web#3
Assignees
Labels
Typescript Issue or pull request is *only* related to TypeScript definition
Milestone

Comments

@dmarsola-irdeto
Copy link

dmarsola-irdeto commented 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.

@dmarsola-irdeto dmarsola-irdeto added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label May 13, 2024
@dmarsola-irdeto dmarsola-irdeto changed the title Replace_With_Component_Name: Brief_Bug_Description Chart property "onMouseDown" not typed May 13, 2024
@melloware 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
@melloware melloware self-assigned this May 13, 2024
@melloware melloware added this to the 10.7.0 milestone May 13, 2024
@melloware
Copy link
Member

OK i think its because it needs to extend HtmlDIVElement so it inherits all the props of a DIV.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typescript Issue or pull request is *only* related to TypeScript definition
Projects
None yet
2 participants