From 1a2ee6af3d7d87160e72e8faca5e38cf01b36fcb Mon Sep 17 00:00:00 2001 From: Fredric Johansson Date: Mon, 23 Feb 2026 17:58:35 +0100 Subject: [PATCH] fix(#225): Fixes rendering issue when there are multiple editors --- src/diff-view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/diff-view.js b/src/diff-view.js index 82fdff4..23fb782 100644 --- a/src/diff-view.js +++ b/src/diff-view.js @@ -318,7 +318,7 @@ CodeMirrorDiffView.prototype.bind = function(container) { if (!notice) { notice = noticeTypes.lgpl; } - const editor = this._queryElement(`#${this.id}`); + const editor = this.el; const splash = dom.getSplash({ notice, left: (editor.offsetWidth - 300) / 2, @@ -1200,7 +1200,7 @@ CodeMirrorDiffView.prototype._renderDiff = function(changes) { CodeMirrorDiffView.prototype._queryElement = function(selector) { const cacheName = `_element:${selector}`; - const element = this[cacheName] || document.querySelector(selector); + const element = this[cacheName] || this.el.querySelector(selector); if (!this[cacheName]) { this[cacheName] = element; }