From ad451c4586e3a9e307a3ab60116f24409ed490c1 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Thu, 10 Sep 2020 12:28:02 -0500 Subject: [PATCH] Fix one innerHTML usage #106395 --- .../contrib/notebook/browser/view/renderers/cellRenderer.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts b/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts index c388e390c67b0..57a7da6185263 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts @@ -597,8 +597,9 @@ class CodeCellDragImageRenderer { } private getDragImageImpl(templateData: BaseCellRenderTemplate, editor: ICodeEditor, type: 'code' | 'markdown'): HTMLElement | null { - const dragImageContainer = DOM.$(`.cell-drag-image.monaco-list-row.focused.${type}-cell-row`); - dragImageContainer.innerHTML = templateData.container.innerHTML; + const dragImageContainer = templateData.container.cloneNode(true) as HTMLElement; + dragImageContainer.classList.forEach(c => dragImageContainer.classList.remove(c)); + dragImageContainer.classList.add('cell-drag-image', 'monaco-list-row', 'focused', `${type}-cell-row`); const editorContainer = dragImageContainer.querySelector('.cell-editor-container'); if (!editorContainer) {