Lots of smaller fixes found in the console logs during testing.

This commit is contained in:
orangemug
2020-04-06 13:59:08 +01:00
parent a1dedd1aa6
commit b8739915b2
6 changed files with 16 additions and 13 deletions
+7 -5
View File
@@ -165,10 +165,12 @@ class LayerListContainer extends React.Component {
return propsChanged;
}
componentDidUpdate () {
const selectedItemNode = this.selectedItemRef.current;
if (selectedItemNode && selectedItemNode.node) {
selectedItemNode.node.scrollIntoView();
componentDidUpdate (prevProps) {
if (prevProps.selectedLayerIndex !== this.props.selectedLayerIndex) {
const selectedItemNode = this.selectedItemRef.current;
if (selectedItemNode && selectedItemNode.node) {
selectedItemNode.node.scrollIntoView();
}
}
}
@@ -184,7 +186,7 @@ class LayerListContainer extends React.Component {
if(layers.length > 1) {
const grp = <LayerListGroup
data-wd-key={[groupPrefix, idx].join('-')}
key={`group-${groupPrefix}`}
key={`group-${groupPrefix}-${idx}`}
title={groupPrefix}
isActive={!this.isCollapsed(groupPrefix, idx) || idx === this.props.selectedLayerIndex}
onActiveToggle={this.toggleLayerGroup.bind(this, groupPrefix, idx)}