Assign a key to cursor and selection components

This commit is contained in:
Nathan Sobo
2014-04-15 10:40:29 -06:00
parent 93388c2048
commit f457b41a81
2 changed files with 4 additions and 3 deletions

View File

@@ -14,11 +14,12 @@ CursorsComponent = React.createClass
render: ->
{editor} = @props
{blinkCursorsOff} = @state
blinkOff = @state.blinkCursorsOff
div className: 'cursors',
for selection in editor.getSelections() when editor.selectionIntersectsVisibleRowRange(selection)
CursorComponent(cursor: selection.cursor, blinkOff: blinkCursorsOff)
{cursor} = selection
CursorComponent({key: cursor.id, cursor, blinkOff})
getInitialState: ->
blinkCursorsOff: false

View File

@@ -11,4 +11,4 @@ SelectionsComponent = React.createClass
div className: 'selections',
for selection in editor.getSelections() when editor.selectionIntersectsVisibleRowRange(selection)
SelectionComponent({selection})
SelectionComponent({key: selection.id, selection})