Skip to content

Commit 9f232d9

Browse files
committed
destructure doc from target like the old days
1 parent 1efd80c commit 9f232d9

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/browser/services/MouseService.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class MouseService implements IMouseService {
4747
}
4848

4949
public bindMouse(target: IMouseServiceTarget, register: (disposable: IDisposable) => void, focus: () => void): void {
50-
const { element } = target;
50+
const { element, document } = target;
5151

5252
/**
5353
* Event listener state handling.
@@ -76,7 +76,7 @@ export class MouseService implements IMouseService {
7676
};
7777
this._altMouseCursor = new AltMouseCursorController(
7878
element,
79-
target.document,
79+
document,
8080
() => this._mouseStateService.areMouseEventsActive
8181
&& !!this._optionsService.rawOptions.mouseEventsRequireAlt
8282
);
@@ -239,7 +239,8 @@ export class MouseService implements IMouseService {
239239
// Note: Other emulators also do this for 'mousedown' while a button
240240
// is held, we currently limit 'mousedown' to the terminal only.
241241
// Use the element's current document in case it moved to another window after open.
242-
const listenerDocument = ctx.target.element.ownerDocument ?? ctx.target.document;
242+
const { element, document: targetDocument } = ctx.target;
243+
const listenerDocument = element.ownerDocument ?? targetDocument;
243244
if (ctx.requestedEvents.mouseup) {
244245
ctx.mouseupListener.value = addDisposableListener(listenerDocument, 'mouseup', ctx.requestedEvents.mouseup);
245246
}

0 commit comments

Comments
 (0)