Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
For #2806, refresh child editor on timeout after redraw event
Browse files Browse the repository at this point in the history
  • Loading branch information
Narciso Jaramillo committed Feb 8, 2013
1 parent 01a2afd commit ebbf3a7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/editor/InlineTextEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,12 @@ define(function (require, exports, module) {

// Update display of inline editors when the hostEditor signals a redraw
CodeMirror.on(this.info, "redraw", function () {
self.editors[0].refresh();
// At the point where we get the redraw, CodeMirror might not yet have actually
// re-added the widget to the DOM. This is filed as https://github.com/marijnh/CodeMirror/issues/1226.
// For now, we can work around it by doing the refresh on a setTimeout().
window.setTimeout(function () {
self.editors[0].refresh();
}, 0);
});

_syncGutterWidths(this.hostEditor);
Expand Down

0 comments on commit ebbf3a7

Please sign in to comment.