Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix aria-flowto not being set #168541

Merged
merged 1 commit into from
Dec 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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