Don't clear elements owned by other components from line nodes map

We should really be recycling elements when they move between lines, but
that's a bigger project.
This commit is contained in:
Nathan Sobo
2017-02-28 18:12:17 -07:00
committed by Antonio Scandurra
parent 19db16664f
commit b8a3e2f163

View File

@@ -984,8 +984,11 @@ class LineComponent {
update () {}
destroy () {
this.props.lineNodesByScreenLineId.delete(this.props.screenLine.id)
this.props.textNodesByScreenLineId.delete(this.props.screenLine.id)
const {lineNodesByScreenLineId, textNodesByScreenLineId, screenLine} = this.props
if (lineNodesByScreenLineId.get(screenLine.id) === this.element) {
lineNodesByScreenLineId.delete(screenLine.id)
textNodesByScreenLineId.delete(screenLine.id)
}
}
}