mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 21:06:57 +00:00
Added try catch for CustomEvent treated as MouseEvent
This commit is contained in:
parent
0cec0816d0
commit
f9ee50e910
1 changed files with 13 additions and 6 deletions
|
@ -327,12 +327,19 @@ export class ElectronWebviewBasedWebview extends Disposable implements Webview {
|
|||
{
|
||||
const rawEvent = event.args[0];
|
||||
const bounds = this._webview.getBoundingClientRect();
|
||||
window.dispatchEvent(new MouseEvent(rawEvent.type, {
|
||||
...rawEvent,
|
||||
clientX: rawEvent.clientX + bounds.left,
|
||||
clientY: rawEvent.clientY + bounds.top,
|
||||
}));
|
||||
return;
|
||||
try {
|
||||
window.dispatchEvent(new MouseEvent(rawEvent.type, {
|
||||
...rawEvent,
|
||||
clientX: rawEvent.clientX + bounds.left,
|
||||
clientY: rawEvent.clientY + bounds.top,
|
||||
}));
|
||||
return;
|
||||
}
|
||||
catch (TypeError) {
|
||||
//CustomEvent was treated as MouseEvent - https://github.com/microsoft/vscode/issues/78915
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
case 'did-set-content':
|
||||
|
|
Loading…
Reference in a new issue