fix: refocus canvas to pick up keystrokes#67
fix: refocus canvas to pick up keystrokes#67arctan95 wants to merge 1 commit intoroerohan:mainfrom arctan95:fix/canvas-mouseleave-event-on-click
Conversation
roerohan
left a comment
There was a problem hiding this comment.
I've requested a small change, also let me know if you've tested it.
Does the same issue happen when you use noVNC (upstream) directly? Honestly, I've never been able to reproduce it 😓
| }; | ||
|
|
||
| const refocusCanvasOnCaptureElem = () => { | ||
| const canvas = document.querySelector('canvas'); |
There was a problem hiding this comment.
If there's another canvas on the page before the noVNC canvas, this line will select that won't it?
Maybe we could do something like
const canvases = Array.from(document.querySelectorAll('canvas'));
const canvas = canvases.filter(({ id }) => id === 'noVNC_mouse_capture_elem');By the way, have you tested this approach? It does feel a little hacky, but since a lot of people have been facing it I'm happy to merge it (provided it doesn't break anything of course 😅)
Yes, this issue does exist upstream. The current approach is a little hacky indeed, hope the upstream will fix it soon. |
Description
Fix
mouseleaveevent triggered when clicking on the canvasResolved issues
Closes #5