From 09b5220d78ed381fa02ca56b1fd4dbd5777a7e7a Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 9 Dec 2022 11:31:52 -0800 Subject: [PATCH] Fix aria-flowto not being set (#168541) For #166768 However this doesn't actually fix the issue in my testing --- .../contrib/webview/browser/webviewElement.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/contrib/webview/browser/webviewElement.ts b/src/vs/workbench/contrib/webview/browser/webviewElement.ts index e3c5db338b4be..fb09ce265221a 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewElement.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewElement.ts @@ -475,28 +475,30 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD this.element!.setAttribute('src', `${this.webviewContentEndpoint(encodedWebviewOrigin)}/${fileName}?${queryString}`); } - public mountTo(_stopBlockingIframeDragEvents: HTMLElement) { + public mountTo(element: HTMLElement) { if (!this.element) { return; } if (this._webviewFindWidget) { - _stopBlockingIframeDragEvents.appendChild(this._webviewFindWidget.getDomNode()); + element.appendChild(this._webviewFindWidget.getDomNode()); } for (const eventName of [EventType.MOUSE_DOWN, EventType.MOUSE_MOVE, EventType.DROP]) { - this._register(addDisposableListener(_stopBlockingIframeDragEvents, eventName, () => { + this._register(addDisposableListener(element, eventName, () => { this._stopBlockingIframeDragEvents(); })); } - for (const node of [_stopBlockingIframeDragEvents, window]) { + for (const node of [element, window]) { this._register(addDisposableListener(node, EventType.DRAG_END, () => { this._stopBlockingIframeDragEvents(); })); } - _stopBlockingIframeDragEvents.appendChild(this.element); + element.id = this.id; // This is used by aria-flow for accessibility order + + element.appendChild(this.element); } private _startBlockingIframeDragEvents() {