fix(#225): Fixes rendering issue when there are multiple editors

This commit is contained in:
Fredric Johansson
2026-02-23 17:58:35 +01:00
committed by GitHub
parent aa496078fd
commit 1a2ee6af3d

View File

@@ -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;
}