Skip to content

Conversation

@Abdkhan14
Copy link
Contributor

@Abdkhan14 Abdkhan14 commented Nov 30, 2025

The behaviour that we are going for is:

  • When hovering, show tooltip + display 'Click for actions' placeholder
  • Click to freeze the position of the tooltip + display actions
  • Click again to restore default tooltip state

  • Echarts does not allow position freezing + actions on the tooltip out of the box, so I had to do it manually.
  • Added ample comments on the new hook, please reach out if anything is confusing!
  • NOTE: Don't worry about duplication, I'm working on a consolidation PR next.
Screen.Recording.2025-11-30.at.3.54.20.PM.mov

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 30, 2025
@Abdkhan14 Abdkhan14 marked this pull request as ready for review November 30, 2025 21:05
@Abdkhan14 Abdkhan14 requested a review from a team as a code owner November 30, 2025 21:05

const handleClickActions = (event: MouseEvent) => {
event.preventDefault();

Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Unconditional preventDefault blocks all document clicks

The handleClickActions event handler calls event.preventDefault() unconditionally at line 105, before checking if the click target has tooltip action attributes. Since this handler is attached to document when the tooltip is frozen, it prevents the default behavior for ALL clicks anywhere on the page—not just clicks on tooltip actions. This could break link navigation, form submissions, checkbox toggling, and other interactive elements outside the chart area while the tooltip is in its frozen state. The event.preventDefault() call should be moved inside the if (action && value && key) conditional block.

Fix in Cursor Fix in Web

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

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants