Skip to content

Commit 1a2ee6a

Browse files
authored
fix(#225): Fixes rendering issue when there are multiple editors
1 parent aa49607 commit 1a2ee6a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/diff-view.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ CodeMirrorDiffView.prototype.bind = function(container) {
318318
if (!notice) {
319319
notice = noticeTypes.lgpl;
320320
}
321-
const editor = this._queryElement(`#${this.id}`);
321+
const editor = this.el;
322322
const splash = dom.getSplash({
323323
notice,
324324
left: (editor.offsetWidth - 300) / 2,
@@ -1200,7 +1200,7 @@ CodeMirrorDiffView.prototype._renderDiff = function(changes) {
12001200

12011201
CodeMirrorDiffView.prototype._queryElement = function(selector) {
12021202
const cacheName = `_element:${selector}`;
1203-
const element = this[cacheName] || document.querySelector(selector);
1203+
const element = this[cacheName] || this.el.querySelector(selector);
12041204
if (!this[cacheName]) {
12051205
this[cacheName] = element;
12061206
}

0 commit comments

Comments
 (0)