mirror of
https://github.com/coder/code-server.git
synced 2026-05-08 21:37:27 +02:00
Hook up shared process sorta
This commit is contained in:
19
packages/vscode/src/fill/dom.ts
Normal file
19
packages/vscode/src/fill/dom.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
// Firefox has no implementation of toElement.
|
||||
if (!("toElement" in MouseEvent.prototype)) {
|
||||
Object.defineProperty(MouseEvent.prototype, "toElement", {
|
||||
get: function (): EventTarget | null {
|
||||
// @ts-ignore
|
||||
const event = this as MouseEvent;
|
||||
switch (event.type) {
|
||||
case "mouseup":
|
||||
case "focusin":
|
||||
case "mousenter":
|
||||
case "mouseover":
|
||||
case "dragenter":
|
||||
return event.target;
|
||||
default:
|
||||
return event.relatedTarget;
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user