Skip to content

Commit

Permalink
Checking that there is indeed a selection before scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
guzmanvig committed Jan 16, 2024
1 parent 06015f7 commit 4702db9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/SeqViewerContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class SeqViewerContainer extends React.Component<SeqViewerContainerProps, SeqVie

// If the selection prop updates, also scroll the lineaer view to the new selection
componentDidUpdate = (prevProps: SeqViewerContainerProps) => {
if (this.props.selection?.start !== prevProps.selection?.start) {
if (this.props.selection?.start !== prevProps.selection?.start && this.props.selection?.start !== this.props.selection?.end) {
this.setCentralIndex("LINEAR", this.props.selection?.start || 0);
}
};
Expand Down

0 comments on commit 4702db9

Please sign in to comment.