Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
fix(preview): stop component from highlighting when only props change
Browse files Browse the repository at this point in the history
  • Loading branch information
Lasse Kuechler authored and lkuechler committed Mar 12, 2018
1 parent 7f9035e commit 37b778f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/component/presentation/react/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ class Preview extends React.Component<PreviewProps> {
this.triggerHighlight();
}

public componentDidUpdate(): void {
this.triggerHighlight();
public componentDidUpdate(prevProps: PreviewProps): void {
if (this.props.selectedElementId) {
this.triggerHighlight();
}
}

private triggerHighlight(): void {
Expand Down

0 comments on commit 37b778f

Please sign in to comment.