This commit is contained in:
Alexandru Dima 2022-09-29 18:31:10 +02:00 committed by GitHub
parent 98a77dca4f
commit 203b26d182
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,7 +64,17 @@ export class GlobalPointerMoveMonitor implements IDisposable {
try {
initialElement.setPointerCapture(pointerId);
this._hooks.add(toDisposable(() => {
initialElement.releasePointerCapture(pointerId);
try {
initialElement.releasePointerCapture(pointerId);
} catch (err) {
// See https://github.com/microsoft/vscode/issues/161731
//
// `releasePointerCapture` sometimes fails when being invoked with the exception:
// DOMException: Failed to execute 'releasePointerCapture' on 'Element':
// No active pointer with the given id is found.
//
// There's no need to do anything in case of failure
}
}));
} catch (err) {
// See https://github.com/microsoft/vscode/issues/144584