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.
This commit is contained in:
Nathan Sobo
2017-04-18 14:45:29 -06:00
committed by Antonio Scandurra
parent 240a472d3a
commit 4d8137a7f5

View File

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