GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix `hoveranywhere`/`clickanywhere` events over editable shapes by alexshoe · Pull Request #7788 · plotly/plotly.js

Conversation

@alexshoe

@alexshoe alexshoe commented May 1, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #7787.

Editable shapes were swallowing plotly_hover / plotly_click events, so hoveranywhere / clickanywhere never fired over them.

Root cause:
dragElement.init sets element.style.pointerEvents = 'all' inline on the shape path so it can receive drag events. That override beats the CSS rule that normally keeps the shape transparent to events, so mouse events stop at the shape and never reach the nsewdrag rect where hoveranywhere / clickanywhere are wired up.

The Fix:
Forward mousemove and click from the shape path to Fx.hover / Fx.click (with the shape's subplot id) when hoveranywhere / clickanywhere is enabled and the user isn't mid-drag. This mirrors the pattern already used by the hover layer in graph_interact.js.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@alexshoe
Fix hoveranywhere/clickanywhere events over editable shapes
464db50
@alexshoe
alexshoe requested review from camdecoster and emilykl May 1, 2026 21:33
@alexshoe
alexshoe marked this pull request as ready for review May 1, 2026 21:33
@camdecoster

camdecoster commented May 1, 2026

Copy link
Copy Markdown
Contributor

Could you please provide testing instructions? I'm happy to paste a mock into devtools.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@camdecoster camdecoster assigned alexshoe May 1, 2026
@alexshoe

alexshoe commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

@camdecoster here's the file that I used to test this:
click_hover_anywhere_test.html

camdecoster reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

camdecoster
camdecoster reviewed May 4, 2026
View reviewed changes

@camdecoster camdecoster left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The fix seems good, but could you please add a test that checks for the proper events when using editable shapes?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/components/shapes/draw.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

alexshoe and others added 7 commits May 4, 2026 14:53
@alexshoe @camdecoster
Update src/components/shapes/draw.js
965930b
Co-authored-by: Cameron DeCoster <[email protected]>
@camdecoster
Merge remote-tracking branch 'origin/master' into fix-shape-anywhere-…
558435c
…events
@camdecoster
Linting/formatting
62b0f2b
@camdecoster
Use nsewdrag element for proper location coord calc
2ab7e84
@camdecoster
Linting/formatting
e481f14
@camdecoster
Add tests for "anywhere" events over editable shapes
8c1f569
@camdecoster
Refactor test file
171f332
@camdecoster camdecoster assigned camdecoster and unassigned alexshoe May 19, 2026
camdecoster
camdecoster approved these changes May 19, 2026
View reviewed changes
@camdecoster
camdecoster merged commit d33fb48 into master May 19, 2026
161 of 162 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@camdecoster
camdecoster deleted the fix-shape-anywhere-events branch May 19, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@camdecoster camdecoster camdecoster approved these changes
@emilykl emilykl Awaiting requested review from emilykl

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@camdecoster camdecoster

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[BUG]: hoveranywhere/clickanywhere events suppressed over editable shapes

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@alexshoe @camdecoster
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.