-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
MouseLeave event triggered when clicking on the canvas embedded in the VncScreen component #5
Comments
@manekenpix thanks for raising the issue, I think I understand what you're trying to explain, but for the sake of clarity, could you explain it in some more detail? Also, would you like to suggest any possible fixes for the same?
|
@roerohan I can provide an example using your demo website:
This triggers a Another way to test this is by logging something when clicking on the main Let me know if I should provide more examples or more details about this issue. |
@manekenpix thanks for the description. I understood what issue you're facing now. I tried to reproduce it on the hosted demo site but wasn't able to. I'll try it out locally and push a fix if I'm able to reproduce it within a few days. Thanks for reporting the issue 😄 |
@roerohan did you use a Chrome-based browser? From what I've seen, it doesn't happen when using Firefox. |
Hi, I tried it on Chrome (Windows 10), and Chromium (Arch Linux and Manjaro). I thought I reproduced it once or twice, but it seems to work for me. Maybe I'm doing something wrong. |
I'm actually having the same issue. It can indeed easily be debugged by adding an It is, however, important to keep the mouse still right after clicking, otherwise you won't notice the effect. |
I devised a temporary fix that seems to work. By listening to canvas mouseout events and putting the focus back on the canvas, this issue doesn't seem to occur anymore.
|
@daanlenaerts I didn't have time to try to find a solution back then. I think your fix should do it, did you try to submit a PR so @roerohan can take a look at it? |
@manekenpix I didn't submit a PR as this quick fix of mine doesn't really seem like an appropriate solution to me. This is implemented outside of the react-vnc package and would likely cause issues for certain applications. |
@daanlenaerts could you explain what you've tried to do here? When the mouse moves out of the canvas, why do we try to focus on the canvas? |
@roerohan This is more of a quick fix than anything else, but it seems to do the job. As discussed in this issue, a The underlying issue, however, is that a Hopefully this clears things up, if not feel free to ask. |
I spent some time debugging this - it looks like what is happening is that, on click, noVNC sets up a prxoy element covering the entire page. This element is transparent and only briefly in the page, but this is what is triggering the mouseLeave event. I narrowed it down to commenting out line 101 ( For now I'm going to work around this problem by patching My workaround is here |
On Chrome-based browsers, clicking on the embedded canvas that shows the stream (inside of this div) triggers a
mouseleave
event, which is handled by handleMouseLeave, and subsequently the div loses the focus.This makes it impossible to interact with the stream after clicking on it until a
mouseenter
event is retriggered (by for example moving the mouse again).The text was updated successfully, but these errors were encountered: