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

Interactive image doesn't receive mousemove events #1634

Closed
falkoschindler opened this issue Sep 16, 2023 · 0 comments · Fixed by #1635
Closed

Interactive image doesn't receive mousemove events #1634

falkoschindler opened this issue Sep 16, 2023 · 0 comments · Fixed by #1635
Assignees
Labels
bug Something isn't working
Milestone

Comments

@falkoschindler
Copy link
Contributor

Description

As reported on r/nicegui, it is currently not possible to receive mousemove events for ui.interactive_image if the cross hair is active.

This seems to be caused by the way registered events are collected. The events needed to update the crosshair overwrite the mousemove events requested by the user:

const allEvents = {};
for (const type of this.events) {
allEvents[type] = (event) => this.onMouseEvent(type, event);
}
if (this.cross) {
allEvents["mouseenter"] = () => (this.cssDisplay = "block");
allEvents["mouseleave"] = () => (this.cssDisplay = "none");
allEvents["mousemove"] = (event) => this.updateCrossHair(event);
}
allEvents["load"] = (event) => this.onImageLoaded(event);
return allEvents;

@falkoschindler falkoschindler self-assigned this Sep 16, 2023
@falkoschindler falkoschindler added the bug Something isn't working label Sep 16, 2023
@falkoschindler falkoschindler added this to the 1.3.14 milestone Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant