plotly / plotly/react-plotly.js

Type error in hover event

Open
#227 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.1k
Forks
138
Avg merge
3d 2h
Merged PRs (30d)
4

Description

There seems to be an error in the type definition. I have the following code which works as expected, but I need the ts-ignore to have it not freak out, but apart from that the code runs as expected.

onHover={event => {
    // @ts-ignore
    event.event.target.style.cursor = 'pointer'
}}

onUnhover={event => {
    // @ts-ignore
    event.event.target.style.cursor = 'auto'
}}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue provides only the onHover and onUnhover snippets and names no files or tests. Start by locating the type definitions for those event handlers and check why event.event.target requires ts-ignore; done means the snippet type-checks without the ignores and the existing behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.