Не подтверждена Коммит 98663479 создал по автору Aiday Marlen Kyzy's avatar Aiday Marlen Kyzy Зафиксировано автором GitHub
Просмотр файлов

Resetting the EditContext on the dom node on rendering - workaround fix for...


Resetting the EditContext on the dom node on rendering - workaround fix for EditContext not working in aux window (#230318)

* wip

* setting the edit context only when the target window has changed

---------

Co-authored-by: default avatarBenjamin Pasero <benjamin.pasero@microsoft.com>
владелец d0858160
......@@ -76,7 +76,7 @@ export class NativeEditContext extends AbstractEditContext {
}));
this._editContext = new EditContext();
this.domNode.domNode.editContext = this._editContext;
this.setEditContextOnDomNode();
this._screenReaderSupport = instantiationService.createInstance(ScreenReaderSupport, this.domNode, context);
......@@ -176,6 +176,12 @@ export class NativeEditContext extends AbstractEditContext {
public refreshFocusState(): void { }
// TODO: added as a workaround fix for https://github.com/microsoft/vscode/issues/229825
// When this issue will be fixed the following should be removed.
public setEditContextOnDomNode(): void {
this.domNode.domNode.editContext = this._editContext;
}
// --- Private methods ---
private _updateDomAttributes(): void {
......
......@@ -111,6 +111,8 @@ export class View extends ViewEventHandler {
private _shouldRecomputeGlyphMarginLanes: boolean = false;
private _renderAnimationFrame: IDisposable | null;
private _targetWindow: CodeWindow | undefined;
constructor(
commandDelegate: ICommandDelegate,
configuration: IEditorConfiguration,
......@@ -456,9 +458,14 @@ export class View extends ViewEventHandler {
throw new BugIndicatingError();
}
if (this._renderAnimationFrame === null) {
const targetWindow = dom.getWindow(this.domNode?.domNode);
if (targetWindow !== this._targetWindow && this._editContext instanceof NativeEditContext) {
this._editContext.setEditContextOnDomNode();
this._targetWindow = targetWindow;
}
const rendering = this._createCoordinatedRendering();
this._renderAnimationFrame = EditorRenderingCoordinator.INSTANCE.scheduleCoordinatedRendering({
window: dom.getWindow(this.domNode?.domNode),
window: targetWindow,
prepareRenderText: () => {
if (this._store.isDisposed) {
throw new BugIndicatingError();
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать