Skip to content

Commit

Permalink
Fix one innerHTML usage #106395
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens committed Sep 10, 2020
1 parent 2e56d31 commit ad451c4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ad451c4

Please sign in to comment.