Skip to content

Commit

Permalink
Fix aria-flowto not being set
Browse files Browse the repository at this point in the history
For microsoft#166768

However this doesn't actually fix the issue in my testing
  • Loading branch information
mjbvz committed Dec 9, 2022
1 parent c6aaa76 commit 410adf8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/vs/workbench/contrib/webview/browser/webviewElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 410adf8

Please sign in to comment.