提交 0625bc30 编写于 作者: R rebornix

fix #104196. detached overflow widget.

上级 65804aee
...@@ -193,6 +193,7 @@ export interface INotebookEditor extends IEditor { ...@@ -193,6 +193,7 @@ export interface INotebookEditor extends IEditor {
getId(): string; getId(): string;
getDomNode(): HTMLElement; getDomNode(): HTMLElement;
getOverflowContainerDomNode(): HTMLElement;
getInnerWebview(): Webview | undefined; getInnerWebview(): Webview | undefined;
/** /**
......
...@@ -76,6 +76,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor ...@@ -76,6 +76,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
private static readonly EDITOR_MEMENTOS = new Map<string, EditorMemento<unknown>>(); private static readonly EDITOR_MEMENTOS = new Map<string, EditorMemento<unknown>>();
private _overlayContainer!: HTMLElement; private _overlayContainer!: HTMLElement;
private _body!: HTMLElement; private _body!: HTMLElement;
private _overflowContainer!: HTMLElement;
private _webview: BackLayerWebView | null = null; private _webview: BackLayerWebView | null = null;
private _webviewResolved: boolean = false; private _webviewResolved: boolean = false;
private _webviewResolvePromise: Promise<BackLayerWebView | null> | null = null; private _webviewResolvePromise: Promise<BackLayerWebView | null> | null = null;
...@@ -356,6 +357,11 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor ...@@ -356,6 +357,11 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
DOM.addClass(this._body, 'cell-list-container'); DOM.addClass(this._body, 'cell-list-container');
this._createCellList(); this._createCellList();
DOM.append(parent, this._body); DOM.append(parent, this._body);
this._overflowContainer = document.createElement('div');
DOM.addClass(this._overflowContainer, 'notebook-overflow-widget-container');
DOM.addClass(this._overflowContainer, 'monaco-editor');
DOM.append(parent, this._overflowContainer);
} }
private _createCellList(): void { private _createCellList(): void {
...@@ -484,6 +490,10 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor ...@@ -484,6 +490,10 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
return this._overlayContainer; return this._overlayContainer;
} }
getOverflowContainerDomNode() {
return this._overflowContainer;
}
onWillHide() { onWillHide() {
this._isVisible = false; this._isVisible = false;
this._editorFocus?.set(false); this._editorFocus?.set(false);
......
...@@ -992,7 +992,8 @@ export class CodeCellRenderer extends AbstractCellRenderer implements IListRende ...@@ -992,7 +992,8 @@ export class CodeCellRenderer extends AbstractCellRenderer implements IListRende
dimension: { dimension: {
width: 0, width: 0,
height: 0 height: 0
} },
overflowWidgetsDomNode: this.notebookEditor.getOverflowContainerDomNode()
}, {}); }, {});
disposables.add(this.editorOptions.onDidChange(newValue => editor.updateOptions(newValue))); disposables.add(this.editorOptions.onDidChange(newValue => editor.updateOptions(newValue)));
......
...@@ -189,7 +189,8 @@ export class StatefulMarkdownCell extends Disposable { ...@@ -189,7 +189,8 @@ export class StatefulMarkdownCell extends Disposable {
dimension: { dimension: {
width: width, width: width,
height: editorHeight height: editorHeight
} },
overflowWidgetsDomNode: this.notebookEditor.getOverflowContainerDomNode()
}, {}); }, {});
this.templateData.currentEditor = this.editor; this.templateData.currentEditor = this.editor;
......
...@@ -103,6 +103,10 @@ export class TestNotebookEditor implements INotebookEditor { ...@@ -103,6 +103,10 @@ export class TestNotebookEditor implements INotebookEditor {
throw new Error('Method not implemented.'); throw new Error('Method not implemented.');
} }
getOverflowContainerDomNode(): HTMLElement {
throw new Error('Method not implemented.');
}
private _onDidChangeModel = new Emitter<NotebookTextModel | undefined>(); private _onDidChangeModel = new Emitter<NotebookTextModel | undefined>();
onDidChangeModel: Event<NotebookTextModel | undefined> = this._onDidChangeModel.event; onDidChangeModel: Event<NotebookTextModel | undefined> = this._onDidChangeModel.event;
getContribution<T extends INotebookEditorContribution>(id: string): T { getContribution<T extends INotebookEditorContribution>(id: string): T {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册