From 4d8137a7f517b8fc2dd2aa41963578798a7e442f Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 18 Apr 2017 14:45:29 -0600 Subject: [PATCH] Add keys to gutterContainer and scrollContainer to avoid recycling issue Previously, when the gutter container was removed due to the editor becoming mini, the lack of keys caused the gutter to be updated with the recycled cursors vnode. But then we tried to remove the cursors vnode not realizing it had been moved and tore down all the references. We probably need to revisit whether it makes sense to recycle vnodes. --- src/text-editor-component.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/text-editor-component.js b/src/text-editor-component.js index 7c17c046c..30dbce515 100644 --- a/src/text-editor-component.js +++ b/src/text-editor-component.js @@ -426,6 +426,7 @@ class TextEditorComponent { this.gutterContainerVnode = $.div( { ref: 'gutterContainer', + key: 'gutterContainer', className: 'gutter-container', style: { position: 'relative', @@ -506,6 +507,7 @@ class TextEditorComponent { return $.div( { ref: 'scrollContainer', + key: 'scrollContainer', className: 'scroll-view', style },